make error consistence for memory fail
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 | 1149 | if (pCtx->pParam->bParseOnly) { |
| 1150 | 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 | 1154 | return GENERATE_ERROR_NO (ERR_LEVEL_PARAM_SETS, ERR_INFO_OUT_OF_MEMORY); |
| 1153 | 1155 | } |
| 1154 | 1156 | if (!kbUseSubsetFlag) { //SPS |
| @@ -1181,6 +1183,7 @@ int32_t ParseSps (PWelsDecoderContext pCtx, PBitStringAux pBsAux, int32_t* pPicW · 26 unmodified lines | ||
| 1181 | 1183 | uint8_t* pBsBuf = static_cast<uint8_t*> (pMa->WelsMallocz (SPS_PPS_BS_SIZE + 4, |
| 1182 | 1184 | "Temp buffer for parse only usage.")); //to reserve 4 bytes for UVLC writing buffer |
| 1183 | 1185 | if (NULL == pBsBuf) { |
| 1186 | + WelsLog (& (pCtx->sLogCtx), WELS_LOG_ERROR, "sps buffer alloc failed for parse only!"); | |
| 1184 | 1187 | pCtx->iErrorCode |= dsOutOfMemory; |
| 1185 | 1188 | return pCtx->iErrorCode; |
| 1186 | 1189 | } |
| @@ -1448,7 +1451,9 @@ int32_t ParsePps (PWelsDecoderContext pCtx, PPps pPpsList, PBitStringAux pBsAux, · 261 unmodified lines | ||
| 1448 | 1451 | } |
| 1449 | 1452 | if (pCtx->pParam->bParseOnly) { |
| 1450 | 1453 | if (kSrcNalLen >= SPS_PPS_BS_SIZE - 4) { //pps bs exceeds |
| 1451 | − pCtx->iErrorCode |= dsOutOfMemory; | |
| 1454 | + WelsLog (& (pCtx->sLogCtx), WELS_LOG_WARNING, "pps payload size (%d) too large for parse only (%d), not supported!", | |
| 1455 | + kSrcNalLen, SPS_PPS_BS_SIZE - 4); | |
| 1456 | + pCtx->iErrorCode |= dsBitstreamError; | |
| 1452 | 1457 | return GENERATE_ERROR_NO (ERR_LEVEL_PARAM_SETS, ERR_INFO_OUT_OF_MEMORY); |
| 1453 | 1458 | } |
| 1454 | 1459 | SPpsBsInfo* pPpsBs = &pCtx->sPpsBsInfo [uiPpsId]; |