History

add checks for spsid and ppsid

Licai Guo committed 12 years ago

Commit ba312b01 parent d767e213 files · +23 −11Browse files

Showing the changes to codec/decoder/core/src/decoder_core.cpp (1 of 3 files). Show all

Unified · Split

codec/decoder/core/src/decoder_core.cpp+12−1
@@ -459,6 +459,10 @@ int32_t ParseSliceHeaderSyntaxs (PWelsDecoderContext pCtx, PBitStringAux pBs, co · 458 unmodified lines
459459 }
460460
461461 //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+ }
462466
463467 pPps = &pCtx->sPpsBuffer[iPpsId];
464468
@@ -473,11 +477,18 @@ int32_t ParseSliceHeaderSyntaxs (PWelsDecoderContext pCtx, PBitStringAux pBs, co · 8 unmodified lines
473477 }
474478
475479 //add check SPS available here
476−
477480 if (kbExtensionFlag) {
478481 pSubsetSps = &pCtx->sSubsetSpsBuffer[pPps->iSpsId];
479482 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+ }
480487 } 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+ }
481492 pSps = &pCtx->sSpsBuffer[pPps->iSpsId];
482493 }
483494 pCtx->pSps = pSps;

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t