diff --git a/media_driver/agnostic/common/codec/hal/codechal_encoder_base.h b/media_driver/agnostic/common/codec/hal/codechal_encoder_base.h index 09693f43549..97d492dd2ba 100644 --- a/media_driver/agnostic/common/codec/hal/codechal_encoder_base.h +++ b/media_driver/agnostic/common/codec/hal/codechal_encoder_base.h @@ -1564,7 +1564,7 @@ class CodechalEncoderState : public Codechal // PAK Scratch Buffers MOS_RESOURCE m_resDeblockingFilterRowStoreScratchBuffer = {}; //!< Handle of deblock row store surface MOS_RESOURCE m_resMPCRowStoreScratchBuffer = {}; //!< Handle of mpc row store surface - MOS_RESOURCE m_resStreamOutBuffer[CODECHAL_ENCODE_RECYCLED_BUFFER_NUM]; //!< Handle of streamout data surface + MOS_RESOURCE m_resStreamOutBuffer[CODECHAL_ENCODE_RECYCLED_BUFFER_NUM] = {}; //!< Handle of streamout data surface // Scaling MHW_KERNEL_STATE m_scaling4xKernelStates[CODEC_NUM_FIELDS_PER_FRAME]; //!< Scaling 4x Kernel States diff --git a/media_softlet/agnostic/common/codec/hal/enc/hevc/features/encode_hevc_header_packer.cpp b/media_softlet/agnostic/common/codec/hal/enc/hevc/features/encode_hevc_header_packer.cpp index e3509156167..00cf4463ed3 100644 --- a/media_softlet/agnostic/common/codec/hal/enc/hevc/features/encode_hevc_header_packer.cpp +++ b/media_softlet/agnostic/common/codec/hal/enc/hevc/features/encode_hevc_header_packer.cpp @@ -478,6 +478,11 @@ MOS_STATUS HevcHeaderPacker::LoadSliceHeaderParams(CodecEncodeHevcSliceHeaderPar m_spsParams.log2_max_pic_order_cnt_lsb_minus4 = pSH->log2_max_pic_order_cnt_lsb_minus4; m_sliceParams.pic_order_cnt_lsb &= ~(0xFFFFFFFF << (m_spsParams.log2_max_pic_order_cnt_lsb_minus4 + 4)); m_sliceParams.num_long_term_pics = pSH->num_long_term_pics; + + if(m_sliceParams.num_long_term_pics > MAX_NUM_LONG_TERM_PICS) + { + return MOS_STATUS_INVALID_PARAMETER; + } for (int i = 0; i < m_sliceParams.num_long_term_pics; i++) { m_sliceParams.lt[i].used_by_curr_pic_lt_flag = pSH->lt[i].used_by_curr_pic_lt_flag;