From 1fa89dfbc67860a85d13e1074aecacfeb6886c2e Mon Sep 17 00:00:00 2001 From: alexsi Date: Thu, 21 Mar 2019 18:07:46 +0800 Subject: [PATCH] [Encode] Fix memory leak when HME is disabled by reg key Fix memory leak when HME is disabled by reg key Change-Id: I355663d041928eb985f0bd8f8f48e28913d2d219 --- .../agnostic/common/codec/hal/codechal_vdenc_avc.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/media_driver/agnostic/common/codec/hal/codechal_vdenc_avc.cpp b/media_driver/agnostic/common/codec/hal/codechal_vdenc_avc.cpp index 48f7210651..1ad2f4c3a3 100644 --- a/media_driver/agnostic/common/codec/hal/codechal_vdenc_avc.cpp +++ b/media_driver/agnostic/common/codec/hal/codechal_vdenc_avc.cpp @@ -1232,7 +1232,10 @@ MOS_STATUS CodechalVdencAvcState::Initialize(CodechalSetting * settings) // common function for all codecs needed if (m_cscDsState && CodecHalUsesRenderEngine(m_codecFunction, m_standard)) { - CODECHAL_ENCODE_CHK_STATUS_RETURN(InitKernelStateMe()); + if (m_hmeSupported) + { + CODECHAL_ENCODE_CHK_STATUS_RETURN(InitKernelStateMe()); + } if (m_staticFrameDetectionEnable) {