Merge pull request #1704 from DDRBoxman/qsvcrash

obs-qsv11: Don't try to free non allocated array on destruction
master
Jim 2019-02-28 18:07:23 -08:00 committed by GitHub
commit 709aac5188
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 4 deletions

View File

@ -584,11 +584,13 @@ mfxStatus QSV_Encoder_Internal::ClearData()
if (m_bUseD3D11 || m_bD3D9HACK)
m_mfxAllocator.Free(m_mfxAllocator.pthis, &m_mfxResponse);
for (int i = 0; i < m_nSurfNum; i++) {
if (!m_bUseD3D11 && !m_bD3D9HACK)
delete m_pmfxSurfaces[i]->Data.Y;
if (m_pmfxSurfaces) {
for (int i = 0; i < m_nSurfNum; i++) {
if (!m_bUseD3D11 && !m_bD3D9HACK)
delete m_pmfxSurfaces[i]->Data.Y;
delete m_pmfxSurfaces[i];
delete m_pmfxSurfaces[i];
}
}
MSDK_SAFE_DELETE_ARRAY(m_pmfxSurfaces);