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
459 }459 }
460 460
461 //add check PPS available here461 //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 pPps = &pCtx->sPpsBuffer[iPpsId];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 //add check SPS available here479 //add check SPS available here
476
477 if (kbExtensionFlag) {480 if (kbExtensionFlag) {
478 pSubsetSps = &pCtx->sSubsetSpsBuffer[pPps->iSpsId];481 pSubsetSps = &pCtx->sSubsetSpsBuffer[pPps->iSpsId];
479 pSps = &pSubsetSps->sSps;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 } else {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 pSps = &pCtx->sSpsBuffer[pPps->iSpsId];492 pSps = &pCtx->sSpsBuffer[pPps->iSpsId];
482 }493 }
483 pCtx->pSps = pSps;494 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