Showing the changes to codec/decoder/core/src/au_parser.cpp (1 of 6 files). Show all
Unified · Split
| @@ -1148,7 +1148,9 @@ int32_t ParseSps (PWelsDecoderContext pCtx, PBitStringAux pBsAux, int32_t* pPicW · 1147 unmodified lines | |||
| 1148 | 1148 | ||
| 1149 | if (pCtx->pParam->bParseOnly) { | 1149 | if (pCtx->pParam->bParseOnly) { |
| 1150 | if (kSrcNalLen >= SPS_PPS_BS_SIZE - 4) { //sps bs exceeds! | 1150 | if (kSrcNalLen >= SPS_PPS_BS_SIZE - 4) { //sps bs exceeds! |
| 1151 | pCtx->iErrorCode |= dsOutOfMemory; | 1151 | WelsLog (& (pCtx->sLogCtx), WELS_LOG_WARNING, "sps payload size (%d) too large for parse only (%d), not supported!", |
| 1152 | kSrcNalLen, SPS_PPS_BS_SIZE - 4); | ||
| 1153 | pCtx->iErrorCode |= dsBitstreamError; | ||
| 1152 | return GENERATE_ERROR_NO (ERR_LEVEL_PARAM_SETS, ERR_INFO_OUT_OF_MEMORY); | 1154 | return GENERATE_ERROR_NO (ERR_LEVEL_PARAM_SETS, ERR_INFO_OUT_OF_MEMORY); |
| 1153 | } | 1155 | } |
| 1154 | if (!kbUseSubsetFlag) { //SPS | 1156 | if (!kbUseSubsetFlag) { //SPS |
| @@ -1181,6 +1183,7 @@ int32_t ParseSps (PWelsDecoderContext pCtx, PBitStringAux pBsAux, int32_t* pPicW · 26 unmodified lines | |||
| 1181 | uint8_t* pBsBuf = static_cast<uint8_t*> (pMa->WelsMallocz (SPS_PPS_BS_SIZE + 4, | 1183 | uint8_t* pBsBuf = static_cast<uint8_t*> (pMa->WelsMallocz (SPS_PPS_BS_SIZE + 4, |
| 1182 | "Temp buffer for parse only usage.")); //to reserve 4 bytes for UVLC writing buffer | 1184 | "Temp buffer for parse only usage.")); //to reserve 4 bytes for UVLC writing buffer |
| 1183 | if (NULL == pBsBuf) { | 1185 | if (NULL == pBsBuf) { |
| 1186 | WelsLog (& (pCtx->sLogCtx), WELS_LOG_ERROR, "sps buffer alloc failed for parse only!"); | ||
| 1184 | pCtx->iErrorCode |= dsOutOfMemory; | 1187 | pCtx->iErrorCode |= dsOutOfMemory; |
| 1185 | return pCtx->iErrorCode; | 1188 | return pCtx->iErrorCode; |
| 1186 | } | 1189 | } |
| @@ -1447,7 +1450,9 @@ int32_t ParsePps (PWelsDecoderContext pCtx, PPps pPpsList, PBitStringAux pBsAux, · 260 unmodified lines | |||
| 1447 | } | 1450 | } |
| 1448 | if (pCtx->pParam->bParseOnly) { | 1451 | if (pCtx->pParam->bParseOnly) { |
| 1449 | if (kSrcNalLen >= SPS_PPS_BS_SIZE - 4) { //pps bs exceeds | 1452 | if (kSrcNalLen >= SPS_PPS_BS_SIZE - 4) { //pps bs exceeds |
| 1450 | pCtx->iErrorCode |= dsOutOfMemory; | 1453 | WelsLog (& (pCtx->sLogCtx), WELS_LOG_WARNING, "pps payload size (%d) too large for parse only (%d), not supported!", |
| 1454 | kSrcNalLen, SPS_PPS_BS_SIZE - 4); | ||
| 1455 | pCtx->iErrorCode |= dsBitstreamError; | ||
| 1451 | return GENERATE_ERROR_NO (ERR_LEVEL_PARAM_SETS, ERR_INFO_OUT_OF_MEMORY); | 1456 | return GENERATE_ERROR_NO (ERR_LEVEL_PARAM_SETS, ERR_INFO_OUT_OF_MEMORY); |
| 1452 | } | 1457 | } |
| 1453 | SPpsBsInfo* pPpsBs = &pCtx->sPpsBsInfo [uiPpsId]; | 1458 | SPpsBsInfo* pPpsBs = &pCtx->sPpsBsInfo [uiPpsId]; |