ref: 6a0f0811aec765ba32a805c519868d59c794b947
parent: 408b7cad17e657718ada77b7270fc6147ada69b6
author: sijchen <sijchen@cisco.com>
date: Mon Feb 15 05:06:43 EST 2016
use WelsUninitEncoderExt in all free process in WelsInitEncoderExt
--- a/codec/encoder/core/src/encoder_ext.cpp
+++ b/codec/encoder/core/src/encoder_ext.cpp
@@ -2526,11 +2526,11 @@
pCtx->sLogCtx = *pLogCtx;
pCtx->pMemAlign = new CMemoryAlign (iCacheLineSize);
- WELS_VERIFY_RETURN_PROC_IF (1, (NULL == pCtx->pMemAlign), FreeMemorySvc (&pCtx))
+ WELS_VERIFY_RETURN_PROC_IF (1, (NULL == pCtx->pMemAlign), WelsUninitEncoderExt (&pCtx))
iRet = AllocCodingParam (&pCtx->pSvcParam, pCtx->pMemAlign);
if (iRet != 0) {
- FreeMemorySvc (&pCtx);
+ WelsUninitEncoderExt (&pCtx);
return iRet;
}
memcpy (pCtx->pSvcParam, pCodingParam, sizeof (SWelsSvcCodingParam)); // confirmed_safe_unsafe_usage
@@ -2537,7 +2537,7 @@
pCtx->pFuncList = (SWelsFuncPtrList*)pCtx->pMemAlign->WelsMalloc (sizeof (SWelsFuncPtrList), "SWelsFuncPtrList");
if (NULL == pCtx->pFuncList) {
- FreeMemorySvc (&pCtx);
+ WelsUninitEncoderExt (&pCtx);
return 1;
}
InitFunctionPointers (pCtx, pCtx->pSvcParam, uiCpuFeatureFlags);