ref: 208400eeb4dafd0b240615a7f8298549248d8f58
parent: 030d320e43c7f2b5b65931ab52160ef1486fd52b
author: huili2 <huili2@cisco.com>
date: Tue Dec 16 19:31:20 EST 2014
unify spsid for pic and add check for mb_qp_delta
--- a/codec/decoder/core/src/decode_slice.cpp
+++ b/codec/decoder/core/src/decode_slice.cpp
@@ -79,8 +79,8 @@
pCurLayer->iMbXyIndex = iNextMbXyIndex;
if (0 == iNextMbXyIndex) {
- pCurLayer->pDec->iSpsId = pSliceHeader->iSpsId;
- pCurLayer->pDec->iPpsId = pSliceHeader->iPpsId;
+ pCurLayer->pDec->iSpsId = pCtx->pSps->iSpsId;
+ pCurLayer->pDec->iPpsId = pCtx->pPps->iPpsId;
pCurLayer->pDec->uiQualityId = pCurLayer->sLayerInfo.sNalHeaderExt.uiQualityId;
}
@@ -744,6 +744,9 @@
int32_t iQpDelta, iId8x8, iId4x4;
WELS_READ_VERIFY (ParseDeltaQpCabac (pCtx, iQpDelta));
+ if (iQpDelta > 25 || iQpDelta < -26) { //out of iQpDelta range
+ return ERR_INFO_INVALID_QP;
+ }
pCurLayer->pLumaQp[iMbXy] = (pSlice->iLastMbQp + iQpDelta + 52) % 52; //update last_mb_qp
pSlice->iLastMbQp = pCurLayer->pLumaQp[iMbXy];
pCurLayer->pChromaQp[iMbXy] = g_kuiChromaQpTable[WELS_CLIP3 (pSlice->iLastMbQp +
--- a/codec/decoder/core/src/manage_dec_ref.cpp
+++ b/codec/decoder/core/src/manage_dec_ref.cpp
@@ -119,6 +119,8 @@
if (pRef != NULL) {
// IDR lost, set new
pRef->bIsComplete = false; // Set complete flag to false for lost IDR ref picture
+ pRef->iSpsId = pCtx->pSps->iSpsId;
+ pRef->iPpsId = pCtx->pPps->iPpsId;
pCtx->iErrorCode |= dsDataErrorConcealed;
bool bCopyPrevious = ((ERROR_CON_FRAME_COPY_CROSS_IDR == pCtx->eErrorConMethod)
|| (ERROR_CON_SLICE_COPY_CROSS_IDR == pCtx->eErrorConMethod)
@@ -260,8 +262,8 @@
pCtx->pDec->uiQualityId = pCtx->pCurDqLayer->sLayerInfo.sNalHeaderExt.uiQualityId;
pCtx->pDec->uiTemporalId = pCtx->pCurDqLayer->sLayerInfo.sNalHeaderExt.uiTemporalId;
- pCtx->pDec->iSpsId = pCtx->pCurDqLayer->sLayerInfo.sSliceInLayer.sSliceHeaderExt.sSliceHeader.iSpsId;
- pCtx->pDec->iPpsId = pCtx->pCurDqLayer->sLayerInfo.sSliceInLayer.sSliceHeaderExt.sSliceHeader.iPpsId;
+ pCtx->pDec->iSpsId = pCtx->pSps->iSpsId;
+ pCtx->pDec->iPpsId = pCtx->pPps->iPpsId;
for (j = pCurAU->uiStartPos; j <= pCurAU->uiEndPos; j++) {
if (pCurAU->pNalUnitsList[j]->sNalHeaderExt.sNalUnitHeader.eNalUnitType == NAL_UNIT_CODED_SLICE_IDR