prevent too many MMCO num overflow
This commit is contained in:
parent
af6a9a838f
commit
4bafe1c430
@ -186,6 +186,7 @@ ERR_INFO_EC_UNEXPECTED_MB_TYPE,
|
||||
ERR_INFO_EC_NO_ENOUGH_NEIGHBOUR_MBS,
|
||||
ERR_INFO_DUPLICATE_FRAME_NUM,
|
||||
//for LTR
|
||||
ERR_INFO_INVALID_MMCO_NUM,
|
||||
ERR_INFO_INVALID_MMCO_OPCODE_BASE,
|
||||
ERR_INFO_INVALID_MMCO_SHORT2UNUSED,
|
||||
EER_INFO_INVALID_MMCO_LONG2UNUSED,
|
||||
|
@ -337,7 +337,7 @@ static int32_t MMCO (PWelsDecoderContext pCtx, PRefPicMarking pRefPicMarking) {
|
||||
PSps pSps = pCtx->pCurDqLayer->sLayerInfo.pSps;
|
||||
int32_t i = 0;
|
||||
int32_t iRet = ERR_NONE;
|
||||
for (i = 0; pRefPicMarking->sMmcoRef[i].uiMmcoType != MMCO_END; i++) {
|
||||
for (i = 0; i < MAX_MMCO_COUNT && pRefPicMarking->sMmcoRef[i].uiMmcoType != MMCO_END; i++) {
|
||||
uint32_t uiMmcoType = pRefPicMarking->sMmcoRef[i].uiMmcoType;
|
||||
int32_t iShortFrameNum = (pCtx->iFrameNum - pRefPicMarking->sMmcoRef[i].iDiffOfPicNum) & ((
|
||||
1 << pSps->uiLog2MaxFrameNum) - 1);
|
||||
@ -352,6 +352,9 @@ static int32_t MMCO (PWelsDecoderContext pCtx, PRefPicMarking pRefPicMarking) {
|
||||
return iRet;
|
||||
}
|
||||
}
|
||||
if (i == MAX_MMCO_COUNT) { //although Rec does not handle this condition, we here prohibit too many MMCO op
|
||||
return ERR_INFO_INVALID_MMCO_NUM;
|
||||
}
|
||||
|
||||
return ERR_NONE;
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user