obs-qsv11: Fix memory leaks

Closes obsproject/obs-studio#3298
This commit is contained in:
Shlee
2020-08-21 00:37:30 +08:00
committed by jp9000
parent b15b5b8561
commit dc4de4db11
2 changed files with 4 additions and 1 deletions
+1 -1
View File
@@ -712,7 +712,7 @@ mfxStatus QSV_Encoder_Internal::ClearData()
}
if (m_outBitstream.Data) {
delete m_outBitstream.Data;
delete[] m_outBitstream.Data;
m_outBitstream.Data = NULL;
}
+3
View File
@@ -393,6 +393,7 @@ mfxStatus _dx9_simple_alloc(mfxFrameAllocRequest *request,
if (FAILED(hr)) {
_dx9_simple_free(response);
MSDK_SAFE_FREE(dxMids);
MSDK_SAFE_FREE(dxMidPtrs);
return MFX_ERR_MEMORY_ALLOC;
}
dxMidPtrs[i] = &dxMids[i];
@@ -402,6 +403,7 @@ mfxStatus _dx9_simple_alloc(mfxFrameAllocRequest *request,
new IDirect3DSurface9 *[request->NumFrameSuggested]);
if (!dxSrf.get()) {
MSDK_SAFE_FREE(dxMids);
MSDK_SAFE_FREE(dxMidPtrs);
return MFX_ERR_MEMORY_ALLOC;
}
hr = videoService->CreateSurface(
@@ -410,6 +412,7 @@ mfxStatus _dx9_simple_alloc(mfxFrameAllocRequest *request,
m_surfaceUsage, target, dxSrf.get(), NULL);
if (FAILED(hr)) {
MSDK_SAFE_FREE(dxMids);
MSDK_SAFE_FREE(dxMidPtrs);
return MFX_ERR_MEMORY_ALLOC;
}