fix order of null pointer protection
This commit is contained in:
parent
a384df3246
commit
bd8ad20e8a
@ -426,7 +426,7 @@ int32_t WelsRequestMem (PWelsDecoderContext pCtx, const int32_t kiMbWidth, const
|
||||
|
||||
if (pCtx->pCabacDecEngine == NULL)
|
||||
pCtx->pCabacDecEngine = (SWelsCabacDecEngine*) WelsMallocz (sizeof (SWelsCabacDecEngine), "pCtx->pCabacDecEngine");
|
||||
|
||||
WELS_VERIFY_RETURN_IF (ERR_INFO_OUT_OF_MEMORY, (NULL == pCtx->pCabacDecEngine))
|
||||
return ERR_NONE;
|
||||
}
|
||||
|
||||
|
@ -1265,8 +1265,6 @@ int32_t InitialDqLayersContext (PWelsDecoderContext pCtx, const int32_t kiMaxWid
|
||||
int8_t) * MB_PARTITION_SIZE, "pCtx->sMb.pSubMbType[]");
|
||||
pCtx->sMb.pSliceIdc[i] = (int32_t*) WelsMallocz (pCtx->sMb.iMbWidth * pCtx->sMb.iMbHeight * sizeof (int32_t),
|
||||
"pCtx->sMb.pSliceIdc[]"); // using int32_t for slice_idc, 4/21/2010
|
||||
if (pCtx->sMb.pSliceIdc[i] != NULL)
|
||||
memset (pCtx->sMb.pSliceIdc[i], 0xff, (pCtx->sMb.iMbWidth * pCtx->sMb.iMbHeight * sizeof (int32_t)));
|
||||
pCtx->sMb.pResidualPredFlag[i] = (int8_t*) WelsMallocz (pCtx->sMb.iMbWidth * pCtx->sMb.iMbHeight * sizeof (int8_t),
|
||||
"pCtx->sMb.pResidualPredFlag[]");
|
||||
//pCtx->sMb.pMotionPredFlag[i] = (uint8_t *) WelsMallocz(pCtx->sMb.iMbWidth * pCtx->sMb.iMbHeight * sizeof(uint8_t), "pCtx->sMb.pMotionPredFlag[]");
|
||||
@ -1303,6 +1301,8 @@ int32_t InitialDqLayersContext (PWelsDecoderContext pCtx, const int32_t kiMaxWid
|
||||
)
|
||||
)
|
||||
|
||||
memset (pCtx->sMb.pSliceIdc[i], 0xff, (pCtx->sMb.iMbWidth * pCtx->sMb.iMbHeight * sizeof (int32_t)));
|
||||
|
||||
pCtx->pDqLayersList[i] = pDq;
|
||||
++ i;
|
||||
} while (i < LAYER_NUM_EXCHANGEABLE);
|
||||
|
@ -90,9 +90,9 @@ PPicture AllocPicture (PWelsDecoderContext pCtx, const int32_t kiPicWidth, const
|
||||
} else {
|
||||
pPic->pBuffer[0] = static_cast<uint8_t*> (WelsMallocz (iLumaSize /* luma */
|
||||
+ (iChromaSize << 1) /* Cb,Cr */, "_pic->buffer[0]"));
|
||||
memset (pPic->pBuffer[0], 128, (iLumaSize + (iChromaSize << 1)));
|
||||
|
||||
WELS_VERIFY_RETURN_PROC_IF (NULL, NULL == pPic->pBuffer[0], FreePicture (pPic));
|
||||
|
||||
memset (pPic->pBuffer[0], 128, (iLumaSize + (iChromaSize << 1)));
|
||||
pPic->iLinesize[0] = iPicWidth;
|
||||
pPic->iLinesize[1] = pPic->iLinesize[2] = iPicChromaWidth;
|
||||
pPic->pBuffer[1] = pPic->pBuffer[0] + iLumaSize;
|
||||
|
Loading…
x
Reference in New Issue
Block a user