return error for cropping data error
Showing the changes to codec/decoder/core/src/au_parser.cpp (1 of 2 files). Show all
Unified · Split
| @@ -1081,14 +1081,16 @@ int32_t ParseSps (PWelsDecoderContext pCtx, PBitStringAux pBsAux, int32_t* pPicW · 1080 unmodified lines | ||
| 1081 | 1081 | WELS_READ_VERIFY (BsGetUe (pBs, &uiCode)); //frame_crop_right_offset |
| 1082 | 1082 | pSps->sFrameCrop.iRightOffset = uiCode; |
| 1083 | 1083 | if ((pSps->sFrameCrop.iLeftOffset + pSps->sFrameCrop.iRightOffset) > ((int32_t)pSps->iMbWidth * 16 / 2)) { |
| 1084 | − WelsLog (& (pCtx->sLogCtx), WELS_LOG_WARNING, "frame_crop_left_offset + frame_crop_right_offset exceeds limits!"); | |
| 1084 | + WelsLog (& (pCtx->sLogCtx), WELS_LOG_ERROR, "frame_crop_left_offset + frame_crop_right_offset exceeds limits!"); | |
| 1085 | + return GENERATE_ERROR_NO (ERR_LEVEL_PARAM_SETS, ERR_INFO_INVALID_CROPPING_DATA); | |
| 1085 | 1086 | } |
| 1086 | 1087 | WELS_READ_VERIFY (BsGetUe (pBs, &uiCode)); //frame_crop_top_offset |
| 1087 | 1088 | pSps->sFrameCrop.iTopOffset = uiCode; |
| 1088 | 1089 | WELS_READ_VERIFY (BsGetUe (pBs, &uiCode)); //frame_crop_bottom_offset |
| 1089 | 1090 | pSps->sFrameCrop.iBottomOffset = uiCode; |
| 1090 | 1091 | if ((pSps->sFrameCrop.iTopOffset + pSps->sFrameCrop.iBottomOffset) > ((int32_t)pSps->iMbHeight * 16 / 2)) { |
| 1091 | − WelsLog (& (pCtx->sLogCtx), WELS_LOG_WARNING, "frame_crop_top_offset + frame_crop_right_offset exceeds limits!"); | |
| 1092 | + WelsLog (& (pCtx->sLogCtx), WELS_LOG_ERROR, "frame_crop_top_offset + frame_crop_right_offset exceeds limits!"); | |
| 1093 | + return GENERATE_ERROR_NO (ERR_LEVEL_PARAM_SETS, ERR_INFO_INVALID_CROPPING_DATA); | |
| 1092 | 1094 | } |
| 1093 | 1095 | } else { |
| 1094 | 1096 | pSps->sFrameCrop.iLeftOffset = 0; // frame_crop_left_offset |