Showing the changes to codec/decoder/core/src/decoder_core.cpp (1 of 1 file). Show all
Unified · Split
| @@ -791,6 +791,13 @@ int32_t ParseSliceHeaderSyntaxs (PWelsDecoderContext pCtx, PBitStringAux pBs, co · 790 unmodified lines | ||
| 791 | 791 | |
| 792 | 792 | pSliceHeadExt->pSubsetSps = pSubsetSps; |
| 793 | 793 | |
| 794 | + if (pSps->iNumRefFrames == 0) { | |
| 795 | + if ((uiSliceType != I_SLICE) && (uiSliceType != SI_SLICE)) { | |
| 796 | + WelsLog (pLogCtx, WELS_LOG_WARNING, "slice_type (%d) not supported for num_ref_frames = 0.", uiSliceType); | |
| 797 | + return GENERATE_ERROR_NO (ERR_LEVEL_SLICE_HEADER, ERR_INFO_INVALID_SLICE_TYPE); | |
| 798 | + } | |
| 799 | + } | |
| 800 | + | |
| 794 | 801 | bIdrFlag = (!kbExtensionFlag && eNalType == NAL_UNIT_CODED_SLICE_IDR) || (kbExtensionFlag && pNalHeaderExt->bIdrFlag); |
| 795 | 802 | pSliceHead->bIdrFlag = bIdrFlag; |
| 796 | 803 | |