History

prevent from return if ref_idx is error

huili2 committed 12 years ago

Commit 13db7fe1 parent f5eb6d41 file · +24 −4Browse files

Showing the changes to codec/decoder (1 of 1 file). Show all

Unified · Split

codec/decoder/core/src/parse_mb_syn_cavlc.cpp+24−4
@@ -1003,7 +1003,12 @@ int32_t ParseInterInfo (PWelsDecoderContext pCtx, int16_t iMvArray[LIST_A][30][M · 1002 unmodified lines
10031003 // Security check: iRefIdx should be in range 0 to num_ref_idx_l0_active_minus1, includsive
10041004 // ref to standard section 7.4.5.1. iRefCount[0] is 1 + num_ref_idx_l0_active_minus1.
10051005 if ((iRefIdx < 0) || (iRefIdx >= iRefCount[0]) || (ppRefPic[iRefIdx] == NULL)) { //error ref_idx
1006− return ERR_INFO_INVALID_REF_INDEX;
1006+ if (pCtx->iErrorConMethod != ERROR_CON_DISABLE) {
1007+ iRefIdx = 0;
1008+ pCtx->iErrorCode |= dsBitstreamError;
1009+ } else {
1010+ return ERR_INFO_INVALID_REF_INDEX;
1011+ }
10071012 }
10081013 } else {
10091014 WelsLog (pCtx, WELS_LOG_WARNING, "inter parse: iMotionPredFlag = 1 not supported. \n");
@@ -1036,7 +1041,12 @@ int32_t ParseInterInfo (PWelsDecoderContext pCtx, int16_t iMvArray[LIST_A][30][M · 26 unmodified lines
10361041 WELS_READ_VERIFY (BsGetTe0 (pBs, iRefCount[0], &uiCode)); //ref_idx_l0[ mbPartIdx ]
10371042 iRefIdx[i] = uiCode;
10381043 if ((iRefIdx[i] < 0) || (iRefIdx[i] >= iRefCount[0]) || (ppRefPic[iRefIdx[i]] == NULL)) { //error ref_idx
1039− return ERR_INFO_INVALID_REF_INDEX;
1044+ if (pCtx->iErrorConMethod != ERROR_CON_DISABLE) {
1045+ iRefIdx[i] = 0;
1046+ pCtx->iErrorCode |= dsBitstreamError;
1047+ } else {
1048+ return ERR_INFO_INVALID_REF_INDEX;
1049+ }
10401050 }
10411051 }
10421052 for (i = 0; i < 2; i++) {
@@ -1065,7 +1075,12 @@ int32_t ParseInterInfo (PWelsDecoderContext pCtx, int16_t iMvArray[LIST_A][30][M · 22 unmodified lines
10651075 WELS_READ_VERIFY (BsGetTe0 (pBs, iRefCount[0], &uiCode)); //ref_idx_l0[ mbPartIdx ]
10661076 iRefIdx[i] = uiCode;
10671077 if ((iRefIdx[i] < 0) || (iRefIdx[i] >= iRefCount[0]) || (ppRefPic[iRefIdx[i]] == NULL)) { //error ref_idx
1068− return ERR_INFO_INVALID_REF_INDEX;
1078+ if (pCtx->iErrorConMethod != ERROR_CON_DISABLE) {
1079+ iRefIdx[i] = 0;
1080+ pCtx->iErrorCode |= dsBitstreamError;
1081+ } else {
1082+ return ERR_INFO_INVALID_REF_INDEX;
1083+ }
10691084 }
10701085 } else {
10711086 WelsLog (pCtx, WELS_LOG_WARNING, "inter parse: iMotionPredFlag = 1 not supported. \n");
@@ -1126,7 +1141,12 @@ int32_t ParseInterInfo (PWelsDecoderContext pCtx, int16_t iMvArray[LIST_A][30][M · 54 unmodified lines
11261141 WELS_READ_VERIFY (BsGetTe0 (pBs, iRefCount[0], &uiCode)); //ref_idx_l0[ mbPartIdx ]
11271142 iRefIdx[i] = uiCode;
11281143 if ((iRefIdx[i] < 0) || (iRefIdx[i] >= iRefCount[0]) || (ppRefPic[iRefIdx[i]] == NULL)) { //error ref_idx
1129− return ERR_INFO_INVALID_REF_INDEX;
1144+ if (pCtx->iErrorConMethod != ERROR_CON_DISABLE) {
1145+ iRefIdx[i] = 0;
1146+ pCtx->iErrorCode |= dsBitstreamError;
1147+ } else {
1148+ return ERR_INFO_INVALID_REF_INDEX;
1149+ }
11301150 }
11311151
11321152 pCurDqLayer->pRefIndex[0][iMbXy][uiScan4Idx ] = pCurDqLayer->pRefIndex[0][iMbXy][uiScan4Idx + 1] =

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