obs-qsv11: Fix various issues detected by Coverity

This commit is contained in:
Richard Stanway
2017-02-25 17:17:12 +01:00
parent d2e9e47bb4
commit a1083d4252
3 changed files with 13 additions and 9 deletions

View File

@@ -517,18 +517,21 @@ mfxStatus QSV_Encoder_Internal::Encode(uint64_t ts, uint8_t *pDataY,
}
mfxFrameSurface1 *pSurface = m_pmfxSurfaces[nSurfIdx];
if (m_bUseD3D11 || m_bD3D9HACK)
if (m_bUseD3D11 || m_bD3D9HACK) {
sts = m_mfxAllocator.Lock(m_mfxAllocator.pthis,
pSurface->Data.MemId, &(pSurface->Data));
MSDK_CHECK_RESULT(sts, MFX_ERR_NONE, sts);
}
sts = LoadNV12(pSurface, pDataY, pDataUV, strideY, strideUV);
MSDK_CHECK_RESULT(sts, MFX_ERR_NONE, sts);
pSurface->Data.TimeStamp = ts;
if (m_bUseD3D11 || m_bD3D9HACK)
if (m_bUseD3D11 || m_bD3D9HACK) {
sts = m_mfxAllocator.Unlock(m_mfxAllocator.pthis,
pSurface->Data.MemId, &(pSurface->Data));
MSDK_CHECK_RESULT(sts, MFX_ERR_NONE, sts);
MSDK_CHECK_RESULT(sts, MFX_ERR_NONE, sts);
}
for (;;) {
// Encode a frame asychronously (returns immediately)
@@ -592,10 +595,8 @@ mfxStatus QSV_Encoder_Internal::ClearData()
delete m_outBitstream.Data;
if (m_pmfxENC != NULL) {
delete m_pmfxENC;
m_pmfxENC = NULL;
}
delete m_pmfxENC;
m_pmfxENC = NULL;
if (m_bUseD3D11 || m_bD3D9HACK)
Release();