From 52d20742fbb6aeb693640ad93467319e11685fb8 Mon Sep 17 00:00:00 2001 From: Takeru Ohta Date: Tue, 17 Sep 2024 15:54:55 +0900 Subject: [PATCH 1/2] Fix to use `max_num_ref_frames` to check `max_long_term_frame_idx_plus1` value --- codec/decoder/core/src/decoder_core.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/codec/decoder/core/src/decoder_core.cpp b/codec/decoder/core/src/decoder_core.cpp index 0835c1007..bfbfc2fa8 100644 --- a/codec/decoder/core/src/decoder_core.cpp +++ b/codec/decoder/core/src/decoder_core.cpp @@ -544,7 +544,7 @@ int32_t ParseDecRefPicMarking (PWelsDecoderContext pCtx, PBitStringAux pBs, PSli bMmco4Exist = true; WELS_READ_VERIFY (BsGetUe (pBs, &uiCode)); //max_long_term_frame_idx_plus1 int32_t iMaxLongTermFrameIdx = -1 + uiCode; - if (iMaxLongTermFrameIdx > int32_t (pSps->uiLog2MaxFrameNum)) { + if (iMaxLongTermFrameIdx > int32_t (pSps->iNumRefFrames)) { //ISO/IEC 14496-10:2009(E) 7.4.3.3 Decoded reference picture marking semantics page 96 return GENERATE_ERROR_NO (ERR_LEVEL_SLICE_HEADER, ERR_INFO_INVALID_REF_MARKING); } From a1b1a4163d79da6477b81fc5ae60cd5fa005362d Mon Sep 17 00:00:00 2001 From: Takeru Ohta Date: Wed, 18 Sep 2024 10:20:50 +0900 Subject: [PATCH 2/2] Remove unnecessary cast --- codec/decoder/core/src/decoder_core.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/codec/decoder/core/src/decoder_core.cpp b/codec/decoder/core/src/decoder_core.cpp index bfbfc2fa8..200d98a36 100644 --- a/codec/decoder/core/src/decoder_core.cpp +++ b/codec/decoder/core/src/decoder_core.cpp @@ -544,7 +544,7 @@ int32_t ParseDecRefPicMarking (PWelsDecoderContext pCtx, PBitStringAux pBs, PSli bMmco4Exist = true; WELS_READ_VERIFY (BsGetUe (pBs, &uiCode)); //max_long_term_frame_idx_plus1 int32_t iMaxLongTermFrameIdx = -1 + uiCode; - if (iMaxLongTermFrameIdx > int32_t (pSps->iNumRefFrames)) { + if (iMaxLongTermFrameIdx > pSps->iNumRefFrames) { //ISO/IEC 14496-10:2009(E) 7.4.3.3 Decoded reference picture marking semantics page 96 return GENERATE_ERROR_NO (ERR_LEVEL_SLICE_HEADER, ERR_INFO_INVALID_REF_MARKING); }