Merge pull request #2051 from huili2/sh_check_slice_type

add slice_type check for num_ref_frame
This commit is contained in:
huili2 2015-07-27 14:19:42 +08:00
commit 11e0fc8376

View File

@ -791,6 +791,13 @@ int32_t ParseSliceHeaderSyntaxs (PWelsDecoderContext pCtx, PBitStringAux pBs, co
pSliceHeadExt->pSubsetSps = pSubsetSps;
if (pSps->iNumRefFrames == 0) {
if ((uiSliceType != I_SLICE) && (uiSliceType != SI_SLICE)) {
WelsLog (pLogCtx, WELS_LOG_WARNING, "slice_type (%d) not supported for num_ref_frames = 0.", uiSliceType);
return GENERATE_ERROR_NO (ERR_LEVEL_SLICE_HEADER, ERR_INFO_INVALID_SLICE_TYPE);
}
}
bIdrFlag = (!kbExtensionFlag && eNalType == NAL_UNIT_CODED_SLICE_IDR) || (kbExtensionFlag && pNalHeaderExt->bIdrFlag);
pSliceHead->bIdrFlag = bIdrFlag;