From b1f56cdcbdc0e42681b81a56c3c96b9f5dd1cfab Mon Sep 17 00:00:00 2001 From: wangqin1 Date: Tue, 2 Jan 2024 09:48:29 +0800 Subject: [PATCH] Update mfx_mpeg2_encode_utils_hw.h corruption bug --- .../encode_hw/mpeg2/include/mfx_mpeg2_encode_utils_hw.h | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/_studio/mfx_lib/encode_hw/mpeg2/include/mfx_mpeg2_encode_utils_hw.h b/_studio/mfx_lib/encode_hw/mpeg2/include/mfx_mpeg2_encode_utils_hw.h index 41caeff0d2..7c0232753b 100644 --- a/_studio/mfx_lib/encode_hw/mpeg2/include/mfx_mpeg2_encode_utils_hw.h +++ b/_studio/mfx_lib/encode_hw/mpeg2/include/mfx_mpeg2_encode_utils_hw.h @@ -138,7 +138,7 @@ namespace MPEG2EncoderHW { mfxStatus sts = MFX_ERR_NONE; mfxExtBRC * extBRC = video.pExtBRC; - if (extBRC->pthis) + if (extBRC && extBRC->pthis) { m_pBRC = extBRC; } @@ -153,7 +153,10 @@ namespace MPEG2EncoderHW void Close() { - m_pBRC->Close(m_pBRC->pthis); + if(m_pBRC->pthis) + { + m_pBRC->Close(m_pBRC->pthis); + } HEVCExtBRC::Destroy(m_BRCLocal); }