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
1003 // Security check: iRefIdx should be in range 0 to num_ref_idx_l0_active_minus1, includsive1003 // Security check: iRefIdx should be in range 0 to num_ref_idx_l0_active_minus1, includsive
1004 // ref to standard section 7.4.5.1. iRefCount[0] is 1 + num_ref_idx_l0_active_minus1.1004 // ref to standard section 7.4.5.1. iRefCount[0] is 1 + num_ref_idx_l0_active_minus1.
1005 if ((iRefIdx < 0) || (iRefIdx >= iRefCount[0]) || (ppRefPic[iRefIdx] == NULL)) { //error ref_idx1005 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 } else {1013 } else {
1009 WelsLog (pCtx, WELS_LOG_WARNING, "inter parse: iMotionPredFlag = 1 not supported. \n");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 WELS_READ_VERIFY (BsGetTe0 (pBs, iRefCount[0], &uiCode)); //ref_idx_l0[ mbPartIdx ]1041 WELS_READ_VERIFY (BsGetTe0 (pBs, iRefCount[0], &uiCode)); //ref_idx_l0[ mbPartIdx ]
1037 iRefIdx[i] = uiCode;1042 iRefIdx[i] = uiCode;
1038 if ((iRefIdx[i] < 0) || (iRefIdx[i] >= iRefCount[0]) || (ppRefPic[iRefIdx[i]] == NULL)) { //error ref_idx1043 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 for (i = 0; i < 2; i++) {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 WELS_READ_VERIFY (BsGetTe0 (pBs, iRefCount[0], &uiCode)); //ref_idx_l0[ mbPartIdx ]1075 WELS_READ_VERIFY (BsGetTe0 (pBs, iRefCount[0], &uiCode)); //ref_idx_l0[ mbPartIdx ]
1066 iRefIdx[i] = uiCode;1076 iRefIdx[i] = uiCode;
1067 if ((iRefIdx[i] < 0) || (iRefIdx[i] >= iRefCount[0]) || (ppRefPic[iRefIdx[i]] == NULL)) { //error ref_idx1077 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 } else {1085 } else {
1071 WelsLog (pCtx, WELS_LOG_WARNING, "inter parse: iMotionPredFlag = 1 not supported. \n");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 WELS_READ_VERIFY (BsGetTe0 (pBs, iRefCount[0], &uiCode)); //ref_idx_l0[ mbPartIdx ]1141 WELS_READ_VERIFY (BsGetTe0 (pBs, iRefCount[0], &uiCode)); //ref_idx_l0[ mbPartIdx ]
1127 iRefIdx[i] = uiCode;1142 iRefIdx[i] = uiCode;
1128 if ((iRefIdx[i] < 0) || (iRefIdx[i] >= iRefCount[0]) || (ppRefPic[iRefIdx[i]] == NULL)) { //error ref_idx1143 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 pCurDqLayer->pRefIndex[0][iMbXy][uiScan4Idx ] = pCurDqLayer->pRefIndex[0][iMbXy][uiScan4Idx + 1] =1152 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