From 4e6e44c888bcacac743e057fec67467373ce8f1d Mon Sep 17 00:00:00 2001 From: zefu_li Date: Tue, 26 Jun 2018 09:38:53 +0800 Subject: [PATCH] [Decode] fix kw issues(CL#777411) fix kw issues Change-Id: Iee57216bb82824cafa75dd8b32117de16ee8300b --- .../agnostic/common/codec/hal/codechal_decode_mpeg2.cpp | 3 +++ media_driver/agnostic/common/codec/hal/codechal_decode_vp8.cpp | 2 ++ 2 files changed, 5 insertions(+) diff --git a/media_driver/agnostic/common/codec/hal/codechal_decode_mpeg2.cpp b/media_driver/agnostic/common/codec/hal/codechal_decode_mpeg2.cpp index d0e5a1abce7..abfc0f52d79 100644 --- a/media_driver/agnostic/common/codec/hal/codechal_decode_mpeg2.cpp +++ b/media_driver/agnostic/common/codec/hal/codechal_decode_mpeg2.cpp @@ -427,6 +427,8 @@ MOS_STATUS CodechalDecodeMpeg2::AllocateResources () CodechalResLock DummyBitstreamLock(m_osInterface, &m_resMpeg2DummyBistream); auto data = DummyBitstreamLock.Lock(CodechalResLock::writeOnly); + + CODECHAL_DECODE_CHK_NULL_RETURN(data); MOS_ZeroMemory(data, size); CODECHAL_DECODE_CHK_STATUS_MESSAGE_RETURN(MOS_SecureMemcpy( @@ -435,6 +437,7 @@ MOS_STATUS CodechalDecodeMpeg2::AllocateResources () (void *)CODECHAL_DECODE_MPEG2_WaDummyBitstream, sizeof(CODECHAL_DECODE_MPEG2_WaDummyBitstream)), "Failed to copy memory."); + } if (m_mode == CODECHAL_DECODE_MODE_MPEG2IDCT) diff --git a/media_driver/agnostic/common/codec/hal/codechal_decode_vp8.cpp b/media_driver/agnostic/common/codec/hal/codechal_decode_vp8.cpp index 11da82ef0f2..33c8485ccef 100644 --- a/media_driver/agnostic/common/codec/hal/codechal_decode_vp8.cpp +++ b/media_driver/agnostic/common/codec/hal/codechal_decode_vp8.cpp @@ -804,6 +804,8 @@ MOS_STATUS CodechalDecodeVp8::ParseFrameHead(uint8_t* bitstreamBuffer, uint32_t CodechalResLock ResourceLock(m_osInterface, &m_resCoefProbBuffer); auto data = (uint8_t*)ResourceLock.Lock(CodechalResLock::writeOnly); + CODECHAL_DECODE_CHK_NULL_RETURN(data); + MOS_SecureMemcpy( data, sizeof(m_vp8FrameHead.FrameContext.CoefProbs),