Showing the changes to codec/decoder/core/src/decoder_core.cpp (1 of 1 file). Show all
Unified · Split
| @@ -543,7 +543,10 @@ int32_t ParseSliceHeaderSyntaxs (PWelsDecoderContext pCtx, PBitStringAux pBs, co · 542 unmodified lines | |||
| 543 | return GENERATE_ERROR_NO (ERR_LEVEL_SLICE_HEADER, ERR_INFO_INVALID_PPS_ID); | 543 | return GENERATE_ERROR_NO (ERR_LEVEL_SLICE_HEADER, ERR_INFO_INVALID_PPS_ID); |
| 544 | } | 544 | } |
| 545 | 545 | ||
| 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]; | ||
| 547 | 550 | ||
| 548 | if (pPps->uiNumSliceGroups == 0) { | 551 | if (pPps->uiNumSliceGroups == 0) { |
| 549 | WelsLog (pLogCtx, WELS_LOG_WARNING, "Invalid PPS referenced"); | 552 | WelsLog (pLogCtx, WELS_LOG_WARNING, "Invalid PPS referenced"); |
| @@ -552,7 +555,10 @@ int32_t ParseSliceHeaderSyntaxs (PWelsDecoderContext pCtx, PBitStringAux pBs, co · 2 unmodified lines | |||
| 552 | } | 555 | } |
| 553 | 556 | ||
| 554 | if (kbExtensionFlag) { | 557 | 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]; | ||
| 556 | pSps = &pSubsetSps->sSps; | 562 | pSps = &pSubsetSps->sSps; |
| 557 | if (pCtx->bSubspsAvailFlags[pPps->iSpsId] == false) { | 563 | if (pCtx->bSubspsAvailFlags[pPps->iSpsId] == false) { |
| 558 | WelsLog (pLogCtx, WELS_LOG_ERROR, "SPS id is invalid!"); | 564 | WelsLog (pLogCtx, WELS_LOG_ERROR, "SPS id is invalid!"); |
| @@ -565,7 +571,10 @@ int32_t ParseSliceHeaderSyntaxs (PWelsDecoderContext pCtx, PBitStringAux pBs, co · 6 unmodified lines | |||
| 565 | pCtx->iErrorCode |= dsNoParamSets; | 571 | pCtx->iErrorCode |= dsNoParamSets; |
| 566 | return GENERATE_ERROR_NO (ERR_LEVEL_SLICE_HEADER, ERR_INFO_INVALID_SPS_ID); | 572 | return GENERATE_ERROR_NO (ERR_LEVEL_SLICE_HEADER, ERR_INFO_INVALID_SPS_ID); |
| 567 | } | 573 | } |
| 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]; | ||
| 569 | } | 578 | } |
| 570 | pSliceHead->iPpsId = iPpsId; | 579 | pSliceHead->iPpsId = iPpsId; |
| 571 | pSliceHead->iSpsId = pPps->iSpsId; | 580 | pSliceHead->iSpsId = pPps->iSpsId; |