Showing the changes to codec/decoder/core/src/decoder_core.cpp (1 of 3 files). Show all
Unified · Split
| @@ -459,6 +459,10 @@ int32_t ParseSliceHeaderSyntaxs (PWelsDecoderContext pCtx, PBitStringAux pBs, co · 458 unmodified lines | ||
| 459 | 459 | } |
| 460 | 460 | |
| 461 | 461 | //add check PPS available here |
| 462 | + if (pCtx->bPpsAvailFlags[iPpsId] == false) { | |
| 463 | + WelsLog (pCtx, WELS_LOG_ERROR, "PPS id is invalid!\n"); | |
| 464 | + return GENERATE_ERROR_NO (ERR_LEVEL_SLICE_HEADER, ERR_INFO_INVALID_PPS_ID); | |
| 465 | + } | |
| 462 | 466 | |
| 463 | 467 | pPps = &pCtx->sPpsBuffer[iPpsId]; |
| 464 | 468 | |
| @@ -473,11 +477,18 @@ int32_t ParseSliceHeaderSyntaxs (PWelsDecoderContext pCtx, PBitStringAux pBs, co · 8 unmodified lines | ||
| 473 | 477 | } |
| 474 | 478 | |
| 475 | 479 | //add check SPS available here |
| 476 | − | |
| 477 | 480 | if (kbExtensionFlag) { |
| 478 | 481 | pSubsetSps = &pCtx->sSubsetSpsBuffer[pPps->iSpsId]; |
| 479 | 482 | pSps = &pSubsetSps->sSps; |
| 483 | + if (pCtx->bSubspsAvailFlags[pPps->iSpsId] == false) { | |
| 484 | + WelsLog (pCtx, WELS_LOG_ERROR, "SPS id is invalid!\n"); | |
| 485 | + return GENERATE_ERROR_NO (ERR_LEVEL_SLICE_HEADER, ERR_INFO_INVALID_SPS_ID); | |
| 486 | + } | |
| 480 | 487 | } else { |
| 488 | + if (pCtx->bSpsAvailFlags[pPps->iSpsId] == false) { | |
| 489 | + WelsLog (pCtx, WELS_LOG_ERROR, "SPS id is invalid!\n"); | |
| 490 | + return GENERATE_ERROR_NO (ERR_LEVEL_SLICE_HEADER, ERR_INFO_INVALID_SPS_ID); | |
| 491 | + } | |
| 481 | 492 | pSps = &pCtx->sSpsBuffer[pPps->iSpsId]; |
| 482 | 493 | } |
| 483 | 494 | pCtx->pSps = pSps; |