History

fix crash bug of sps/pps

huili2 committed 12 years ago

Commit 3c4279c1 parent 195d1361 file · +12 −3Browse files

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

Unified · Split

codec/decoder/core/src/decoder_core.cpp+12−3
@@ -543,7 +543,10 @@ int32_t ParseSliceHeaderSyntaxs (PWelsDecoderContext pCtx, PBitStringAux pBs, co · 542 unmodified lines
543543 return GENERATE_ERROR_NO (ERR_LEVEL_SLICE_HEADER, ERR_INFO_INVALID_PPS_ID);
544544 }
545545
546− pPps = &pCtx->sPpsBuffer[iPpsId];
546+ if (pCtx->iOverwriteFlags & OVERWRITE_PPS)
547+ pPps = &pCtx->sPpsBuffer[MAX_PPS_COUNT];
548+ else
549+ pPps = &pCtx->sPpsBuffer[iPpsId];
547550
548551 if (pPps->uiNumSliceGroups == 0) {
549552 WelsLog (pLogCtx, WELS_LOG_WARNING, "Invalid PPS referenced");
@@ -552,7 +555,10 @@ int32_t ParseSliceHeaderSyntaxs (PWelsDecoderContext pCtx, PBitStringAux pBs, co · 2 unmodified lines
552555 }
553556
554557 if (kbExtensionFlag) {
555− pSubsetSps = &pCtx->sSubsetSpsBuffer[pPps->iSpsId];
558+ if (pCtx->iOverwriteFlags & OVERWRITE_SUBSETSPS)
559+ pSubsetSps = &pCtx->sSubsetSpsBuffer[MAX_SPS_COUNT];
560+ else
561+ pSubsetSps = &pCtx->sSubsetSpsBuffer[pPps->iSpsId];
556562 pSps = &pSubsetSps->sSps;
557563 if (pCtx->bSubspsAvailFlags[pPps->iSpsId] == false) {
558564 WelsLog (pLogCtx, WELS_LOG_ERROR, "SPS id is invalid!");
@@ -565,7 +571,10 @@ int32_t ParseSliceHeaderSyntaxs (PWelsDecoderContext pCtx, PBitStringAux pBs, co · 6 unmodified lines
565571 pCtx->iErrorCode |= dsNoParamSets;
566572 return GENERATE_ERROR_NO (ERR_LEVEL_SLICE_HEADER, ERR_INFO_INVALID_SPS_ID);
567573 }
568− pSps = &pCtx->sSpsBuffer[pPps->iSpsId];
574+ if (pCtx->iOverwriteFlags & OVERWRITE_SPS)
575+ pSps = &pCtx->sSpsBuffer[MAX_SPS_COUNT];
576+ else
577+ pSps = &pCtx->sSpsBuffer[pPps->iSpsId];
569578 }
570579 pSliceHead->iPpsId = iPpsId;
571580 pSliceHead->iSpsId = pPps->iSpsId;

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