Fix the bug that decoder not return when level limit occur
Showing the changes to codec/decoder/core/src (1 of 1 file). Show all
Unified · Split
| @@ -1039,7 +1039,8 @@ int32_t ParseSps (PWelsDecoderContext pCtx, PBitStringAux pBsAux, int32_t* pPicW · 1038 unmodified lines | |||
| 1039 | return GENERATE_ERROR_NO (ERR_LEVEL_PARAM_SETS, ERR_INFO_INVALID_MAX_MB_SIZE); | 1039 | return GENERATE_ERROR_NO (ERR_LEVEL_PARAM_SETS, ERR_INFO_INVALID_MAX_MB_SIZE); |
| 1040 | } | 1040 | } |
| 1041 | if (((uint64_t)pSps->iMbWidth * (uint64_t)pSps->iMbWidth) > (uint64_t) (8 * pSLevelLimits->uiMaxFS)) { | 1041 | if (((uint64_t)pSps->iMbWidth * (uint64_t)pSps->iMbWidth) > (uint64_t) (8 * pSLevelLimits->uiMaxFS)) { |
| 1042 | WelsLog (& (pCtx->sLogCtx), WELS_LOG_WARNING, " the pic_width_in_mbs exceeds the level limits!"); | 1042 | WelsLog (& (pCtx->sLogCtx), WELS_LOG_ERROR, " the pic_width_in_mbs exceeds the level limits!"); |
| 1043 | return GENERATE_ERROR_NO (ERR_LEVEL_PARAM_SETS, ERR_INFO_INVALID_MAX_MB_SIZE); | ||
| 1043 | } | 1044 | } |
| 1044 | WELS_READ_VERIFY (BsGetUe (pBs, &uiCode)); //pic_height_in_map_units_minus1 | 1045 | WELS_READ_VERIFY (BsGetUe (pBs, &uiCode)); //pic_height_in_map_units_minus1 |
| 1045 | pSps->iMbHeight = PIC_HEIGHT_IN_MAP_UNITS_OFFSET + uiCode; | 1046 | pSps->iMbHeight = PIC_HEIGHT_IN_MAP_UNITS_OFFSET + uiCode; |
| @@ -1048,7 +1049,8 @@ int32_t ParseSps (PWelsDecoderContext pCtx, PBitStringAux pBsAux, int32_t* pPicW · 2 unmodified lines | |||
| 1048 | return GENERATE_ERROR_NO (ERR_LEVEL_PARAM_SETS, ERR_INFO_INVALID_MAX_MB_SIZE); | 1049 | return GENERATE_ERROR_NO (ERR_LEVEL_PARAM_SETS, ERR_INFO_INVALID_MAX_MB_SIZE); |
| 1049 | } | 1050 | } |
| 1050 | if (((uint64_t)pSps->iMbHeight * (uint64_t)pSps->iMbHeight) > (uint64_t) (8 * pSLevelLimits->uiMaxFS)) { | 1051 | if (((uint64_t)pSps->iMbHeight * (uint64_t)pSps->iMbHeight) > (uint64_t) (8 * pSLevelLimits->uiMaxFS)) { |
| 1051 | WelsLog (& (pCtx->sLogCtx), WELS_LOG_WARNING, " the pic_height_in_mbs exceeds the level limits!"); | 1052 | WelsLog (& (pCtx->sLogCtx), WELS_LOG_ERROR, " the pic_height_in_mbs exceeds the level limits!"); |
| 1053 | return GENERATE_ERROR_NO (ERR_LEVEL_PARAM_SETS, ERR_INFO_INVALID_MAX_MB_SIZE); | ||
| 1052 | } | 1054 | } |
| 1053 | uint32_t uiTmp32 = pSps->iMbWidth * pSps->iMbHeight; | 1055 | uint32_t uiTmp32 = pSps->iMbWidth * pSps->iMbHeight; |
| 1054 | if (uiTmp32 > (uint32_t)pSLevelLimits->uiMaxFS) { | 1056 | if (uiTmp32 > (uint32_t)pSLevelLimits->uiMaxFS) { |