decklink: Add destructor for OBSVideoFrame, initialize flags

Fixes a memory leak and potential access to undefined variable.
Detected by Coverity Scan.
master
Richard Stanway 2021-04-20 19:25:17 +02:00
parent 4c8b209bf0
commit e7df070438
2 changed files with 7 additions and 1 deletions

View File

@ -11,6 +11,11 @@ OBSVideoFrame::OBSVideoFrame(long width, long height,
this->pixelFormat = pixelFormat;
}
OBSVideoFrame::~OBSVideoFrame()
{
delete this->data;
}
HRESULT OBSVideoFrame::SetFlags(BMDFrameFlags newFlags)
{
flags = newFlags;

View File

@ -5,7 +5,7 @@
class OBSVideoFrame : public IDeckLinkMutableVideoFrame {
private:
BMDFrameFlags flags;
BMDFrameFlags flags = bmdFrameFlagDefault;
BMDPixelFormat pixelFormat = bmdFormat8BitYUV;
long width;
@ -16,6 +16,7 @@ private:
public:
OBSVideoFrame(long width, long height, BMDPixelFormat pixelFormat);
~OBSVideoFrame();
HRESULT STDMETHODCALLTYPE SetFlags(BMDFrameFlags newFlags) override;