Skip to content

Commit f70c905

Browse files
authored
Fix a bug where ISVCDecoder::DecodeFrameNoDelay() could fail when decoding an H.264 stream encoded by the Apple HWA encoder. (#3787)
* Fix to use `max_num_ref_frames` to check `max_long_term_frame_idx_plus1` value * Remove unnecessary cast
1 parent 2a3207b commit f70c905

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

codec/decoder/core/src/decoder_core.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -544,7 +544,7 @@ int32_t ParseDecRefPicMarking (PWelsDecoderContext pCtx, PBitStringAux pBs, PSli
544544
bMmco4Exist = true;
545545
WELS_READ_VERIFY (BsGetUe (pBs, &uiCode)); //max_long_term_frame_idx_plus1
546546
int32_t iMaxLongTermFrameIdx = -1 + uiCode;
547-
if (iMaxLongTermFrameIdx > int32_t (pSps->uiLog2MaxFrameNum)) {
547+
if (iMaxLongTermFrameIdx > pSps->iNumRefFrames) {
548548
//ISO/IEC 14496-10:2009(E) 7.4.3.3 Decoded reference picture marking semantics page 96
549549
return GENERATE_ERROR_NO (ERR_LEVEL_SLICE_HEADER, ERR_INFO_INVALID_REF_MARKING);
550550
}

0 commit comments

Comments
 (0)