use WelsUninitEncoderExt in all free process in WelsInitEncoderExt
This commit is contained in:
parent
408b7cad17
commit
6a0f0811ae
@ -2526,18 +2526,18 @@ int32_t WelsInitEncoderExt (sWelsEncCtx** ppCtx, SWelsSvcCodingParam* pCodingPar
|
||||
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
|
||||
|
||||
pCtx->pFuncList = (SWelsFuncPtrList*)pCtx->pMemAlign->WelsMalloc (sizeof (SWelsFuncPtrList), "SWelsFuncPtrList");
|
||||
if (NULL == pCtx->pFuncList) {
|
||||
FreeMemorySvc (&pCtx);
|
||||
WelsUninitEncoderExt (&pCtx);
|
||||
return 1;
|
||||
}
|
||||
InitFunctionPointers (pCtx, pCtx->pSvcParam, uiCpuFeatureFlags);
|
||||
|
Loading…
x
Reference in New Issue
Block a user