ref: 3c2caa4a52fdbc480ae9c41cd1081bd6627822aa
parent: b555404fe1652d7a22a896bb6ccb91988aae2502
parent: 94b55520b8fd861b80e0e36ac82a553361fffdcf
author: huili2 <[email protected]>
date: Tue Jan 10 04:12:03 EST 2017
Merge pull request #2641 from ruil2/memory use the correct return value when memory can't be allocated.
--- a/codec/encoder/core/src/encoder_ext.cpp
+++ b/codec/encoder/core/src/encoder_ext.cpp
@@ -3627,6 +3627,11 @@
}
// perform csc/denoise/downsample/padding, generate spatial layers
iSpatialNum = pCtx->pVpp->BuildSpatialPicList (pCtx, pSrcPic);
+ if (iSpatialNum == -1) {
+ WelsLog (& (pCtx->sLogCtx), WELS_LOG_ERROR, "Failed in allocating memory in BuildSpatialPicList");
+ return ENC_RETURN_MEMALLOCERR;
+ }
+
if (pCtx->pFuncList->pfRc.pfWelsUpdateMaxBrWindowStatus) {
pCtx->pFuncList->pfRc.pfWelsUpdateMaxBrWindowStatus (pCtx, iSpatialNum, pFbi->uiTimeStamp);
}