avdevice/decklink_enc: do not reference this after freeing it
authorMarton Balint <cus@passwd.hu>
Sat, 10 Dec 2016 12:57:01 +0000 (13:57 +0100)
committerMarton Balint <cus@passwd.hu>
Tue, 27 Dec 2016 00:11:59 +0000 (01:11 +0100)
Fixes Coverity CID 1396863.

Signed-off-by: Marton Balint <cus@passwd.hu>
libavdevice/decklink_enc.cpp

index dc4a24b..ad00224 100644 (file)
@@ -55,7 +55,7 @@ public:
 
     virtual HRESULT STDMETHODCALLTYPE QueryInterface(REFIID iid, LPVOID *ppv) { return E_NOINTERFACE; }
     virtual ULONG   STDMETHODCALLTYPE AddRef(void)                            { return ++_refs; }
-    virtual ULONG   STDMETHODCALLTYPE Release(void)                           { if (!--_refs) delete this; return _refs; }
+    virtual ULONG   STDMETHODCALLTYPE Release(void)                           { if (!--_refs) {delete this; return 0;} return _refs; }
 
     struct decklink_ctx *_ctx;
     AVFrame *_avframe;