Showing the changes to codec/decoder (1 of 1 file). Show all
Unified · Split
| @@ -1003,7 +1003,12 @@ int32_t ParseInterInfo (PWelsDecoderContext pCtx, int16_t iMvArray[LIST_A][30][M · 1002 unmodified lines | ||
| 1003 | 1003 | // Security check: iRefIdx should be in range 0 to num_ref_idx_l0_active_minus1, includsive |
| 1004 | 1004 | // ref to standard section 7.4.5.1. iRefCount[0] is 1 + num_ref_idx_l0_active_minus1. |
| 1005 | 1005 | 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 | + } | |
| 1007 | 1012 | } |
| 1008 | 1013 | } else { |
| 1009 | 1014 | 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 | ||
| 1036 | 1041 | WELS_READ_VERIFY (BsGetTe0 (pBs, iRefCount[0], &uiCode)); //ref_idx_l0[ mbPartIdx ] |
| 1037 | 1042 | iRefIdx[i] = uiCode; |
| 1038 | 1043 | 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 | + } | |
| 1040 | 1050 | } |
| 1041 | 1051 | } |
| 1042 | 1052 | 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 | ||
| 1065 | 1075 | WELS_READ_VERIFY (BsGetTe0 (pBs, iRefCount[0], &uiCode)); //ref_idx_l0[ mbPartIdx ] |
| 1066 | 1076 | iRefIdx[i] = uiCode; |
| 1067 | 1077 | 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 | + } | |
| 1069 | 1084 | } |
| 1070 | 1085 | } else { |
| 1071 | 1086 | 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 | ||
| 1126 | 1141 | WELS_READ_VERIFY (BsGetTe0 (pBs, iRefCount[0], &uiCode)); //ref_idx_l0[ mbPartIdx ] |
| 1127 | 1142 | iRefIdx[i] = uiCode; |
| 1128 | 1143 | 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 | + } | |
| 1130 | 1150 | } |
| 1131 | 1151 | |
| 1132 | 1152 | pCurDqLayer->pRefIndex[0][iMbXy][uiScan4Idx ] = pCurDqLayer->pRefIndex[0][iMbXy][uiScan4Idx + 1] = |