History

modify return value check inside decoder

unknown committed 10 years ago

Commit 9cb4f4e1 parent 13586a311 files · +216 −197Browse files

Showing the changes to codec/decoder/core/src/au_parser.cpp (1 of 11 files). Show all

Unified · Split

codec/decoder/core/src/au_parser.cpp+9−8
@@ -782,7 +782,7 @@ int32_t DecodeSpsSvcExt (PWelsDecoderContext pCtx, PSubsetSps pSpsExt, PBitStrin · 781 unmodified lines
782782
783783
784784
785− return 0;
785+ return ERR_NONE;
786786 }
787787
788788 const SLevelLimits* GetLevelLimits (int32_t iLevelIdx, bool bConstraint3) {
@@ -915,6 +915,7 @@ int32_t ParseSps (PWelsDecoderContext pCtx, PBitStringAux pBsAux, int32_t* pPicW · 126 unmodified lines
915915 int32_t iSpsId;
916916 uint32_t uiCode;
917917 int32_t iCode;
918+ int32_t iRet = ERR_NONE;
918919 bool bConstraintSetFlags[6] = { false };
919920 const bool kbUseSubsetFlag = IS_SUBSET_SPS_NAL (pNalHead->eNalUnitType);
920921
@@ -1207,8 +1208,8 @@ int32_t ParseSps (PWelsDecoderContext pCtx, PBitStringAux pBsAux, int32_t* pPicW · 286 unmodified lines
12071208 }
12081209 // Check if SPS SVC extension applicated
12091210 if (kbUseSubsetFlag && (PRO_SCALABLE_BASELINE == uiProfileIdc || PRO_SCALABLE_HIGH == uiProfileIdc)) {
1210− if (DecodeSpsSvcExt (pCtx, pSubsetSps, pBs) != ERR_NONE) {
1211− return -1;
1211+ if ((iRet = DecodeSpsSvcExt (pCtx, pSubsetSps, pBs)) != ERR_NONE) {
1212+ return iRet;
12121213 }
12131214
12141215 WELS_READ_VERIFY (BsGetOneBit (pBs, &uiCode)); //svc_vui_parameters_present_flag
@@ -1271,7 +1272,7 @@ int32_t ParseSps (PWelsDecoderContext pCtx, PBitStringAux pBsAux, int32_t* pPicW · 56 unmodified lines
12711272 pCtx->bSpsAvailFlags[iSpsId] = true;
12721273 pCtx->bSpsExistAheadFlag = true;
12731274 }
1274− return 0;
1275+ return ERR_NONE;
12751276 }
12761277
12771278 /*!
@@ -1301,7 +1302,7 @@ int32_t ParsePps (PWelsDecoderContext pCtx, PPps pPpsList, PBitStringAux pBsAux, · 23 unmodified lines
13011302 WELS_READ_VERIFY (BsGetUe (pBsAux, &uiCode)); //pic_parameter_set_id
13021303 uiPpsId = uiCode;
13031304 if (uiPpsId >= MAX_PPS_COUNT) {
1304− return ERR_INFO_PPS_ID_OVERFLOW;
1305+ return GENERATE_ERROR_NO (ERR_LEVEL_PARAM_SETS, ERR_INFO_PPS_ID_OVERFLOW);
13051306 }
13061307 pPps = &sTempPps;
13071308 memset (pPps, 0, sizeof (SPps));
@@ -1311,7 +1312,7 @@ int32_t ParsePps (PWelsDecoderContext pCtx, PPps pPpsList, PBitStringAux pBsAux, · 3 unmodified lines
13111312 pPps->iSpsId = uiCode;
13121313
13131314 if (pPps->iSpsId >= MAX_SPS_COUNT) {
1314− return ERR_INFO_SPS_ID_OVERFLOW;
1315+ return GENERATE_ERROR_NO (ERR_LEVEL_PARAM_SETS, ERR_INFO_SPS_ID_OVERFLOW);
13151316 }
13161317
13171318 WELS_READ_VERIFY (BsGetOneBit (pBsAux, &uiCode)); //entropy_coding_mode_flag
@@ -1323,7 +1324,7 @@ int32_t ParsePps (PWelsDecoderContext pCtx, PPps pPpsList, PBitStringAux pBsAux, · 5 unmodified lines
13231324 pPps->uiNumSliceGroups = NUM_SLICE_GROUPS_OFFSET + uiCode;
13241325
13251326 if (pPps->uiNumSliceGroups > MAX_SLICEGROUP_IDS) {
1326− return ERR_INFO_INVALID_SLICEGROUP;
1327+ return GENERATE_ERROR_NO (ERR_LEVEL_PARAM_SETS, ERR_INFO_INVALID_SLICEGROUP);
13271328 }
13281329
13291330 if (pPps->uiNumSliceGroups > 1) {
@@ -1354,7 +1355,7 @@ int32_t ParsePps (PWelsDecoderContext pCtx, PPps pPpsList, PBitStringAux pBsAux, · 24 unmodified lines
13541355
13551356 if (pPps->uiNumRefIdxL0Active > MAX_REF_PIC_COUNT ||
13561357 pPps->uiNumRefIdxL1Active > MAX_REF_PIC_COUNT) {
1357− return ERR_INFO_REF_COUNT_OVERFLOW;
1358+ return GENERATE_ERROR_NO (ERR_LEVEL_PARAM_SETS, ERR_INFO_REF_COUNT_OVERFLOW);
13581359 }
13591360
13601361 WELS_READ_VERIFY (BsGetOneBit (pBsAux, &uiCode)); //weighted_pred_flag

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