Showing the changes to codec/decoder/core/src/au_parser.cpp (1 of 1 file). Show all
Unified · Split
| @@ -951,6 +951,8 @@ int32_t ParseSps (PWelsDecoderContext pCtx, PBitStringAux pBsAux, int32_t* pPicW · 950 unmodified lines | ||
| 951 | 951 | pSubsetSps = &sTempSubsetSps; |
| 952 | 952 | pSps = &sTempSubsetSps.sSps; |
| 953 | 953 | memset (pSubsetSps, 0, sizeof (SSubsetSps)); |
| 954 | + // Use the level 5.2 for compatibility | |
| 955 | + const SLevelLimits* pSMaxLevelLimits = GetLevelLimits (52, false); | |
| 954 | 956 | const SLevelLimits* pSLevelLimits = GetLevelLimits (uiLevelIdc, bConstraintSetFlags[3]); |
| 955 | 957 | if (NULL == pSLevelLimits) { |
| 956 | 958 | WelsLog (& (pCtx->sLogCtx), WELS_LOG_WARNING, "ParseSps(): level_idx (%d).\n", uiLevelIdc); |
| @@ -1056,7 +1058,9 @@ int32_t ParseSps (PWelsDecoderContext pCtx, PBitStringAux pBsAux, int32_t* pPicW · 99 unmodified lines | ||
| 1056 | 1058 | } |
| 1057 | 1059 | if (((uint64_t)pSps->iMbWidth * (uint64_t)pSps->iMbWidth) > (uint64_t) (8 * pSLevelLimits->uiMaxFS)) { |
| 1058 | 1060 | WelsLog (& (pCtx->sLogCtx), WELS_LOG_ERROR, " the pic_width_in_mbs exceeds the level limits!"); |
| 1059 | − return GENERATE_ERROR_NO (ERR_LEVEL_PARAM_SETS, ERR_INFO_INVALID_MAX_MB_SIZE); | |
| 1061 | + if (((uint64_t)pSps->iMbWidth * (uint64_t)pSps->iMbWidth) > (uint64_t) (8 * pSMaxLevelLimits->uiMaxFS)) { | |
| 1062 | + return GENERATE_ERROR_NO (ERR_LEVEL_PARAM_SETS, ERR_INFO_INVALID_MAX_MB_SIZE); | |
| 1063 | + } | |
| 1060 | 1064 | } |
| 1061 | 1065 | WELS_READ_VERIFY (BsGetUe (pBs, &uiCode)); //pic_height_in_map_units_minus1 |
| 1062 | 1066 | pSps->iMbHeight = PIC_HEIGHT_IN_MAP_UNITS_OFFSET + uiCode; |
| @@ -1066,7 +1070,9 @@ int32_t ParseSps (PWelsDecoderContext pCtx, PBitStringAux pBsAux, int32_t* pPicW · 3 unmodified lines | ||
| 1066 | 1070 | } |
| 1067 | 1071 | if (((uint64_t)pSps->iMbHeight * (uint64_t)pSps->iMbHeight) > (uint64_t) (8 * pSLevelLimits->uiMaxFS)) { |
| 1068 | 1072 | WelsLog (& (pCtx->sLogCtx), WELS_LOG_ERROR, " the pic_height_in_mbs exceeds the level limits!"); |
| 1069 | − return GENERATE_ERROR_NO (ERR_LEVEL_PARAM_SETS, ERR_INFO_INVALID_MAX_MB_SIZE); | |
| 1073 | + if (((uint64_t)pSps->iMbHeight * (uint64_t)pSps->iMbHeight) > (uint64_t) (8 * pSMaxLevelLimits->uiMaxFS)) { | |
| 1074 | + return GENERATE_ERROR_NO (ERR_LEVEL_PARAM_SETS, ERR_INFO_INVALID_MAX_MB_SIZE); | |
| 1075 | + } | |
| 1070 | 1076 | } |
| 1071 | 1077 | uint32_t uiTmp32 = pSps->iMbWidth * pSps->iMbHeight; |
| 1072 | 1078 | if (uiTmp32 > (uint32_t)pSLevelLimits->uiMaxFS) { |