This function actually zero-initializes the allocated memory, thus make this clear in the function name. This makes the function name match the same behaviour in the encoder.
Showing the changes to codec/decoder/core/src/decoder.cpp (1 of 12 files). Show all
Unified · Split
| @@ -67,13 +67,13 @@ static int32_t CreatePicBuff (PWelsDecoderContext pCtx, PPicBuff* ppPicBuf, cons · 66 unmodified lines | |||
| 67 | return 1; | 67 | return 1; |
| 68 | } | 68 | } |
| 69 | 69 | ||
| 70 | pPicBuf = (PPicBuff)WelsMalloc (sizeof (SPicBuff), "PPicBuff"); | 70 | pPicBuf = (PPicBuff)WelsMallocz (sizeof (SPicBuff), "PPicBuff"); |
| 71 | 71 | ||
| 72 | if (NULL == pPicBuf) { | 72 | if (NULL == pPicBuf) { |
| 73 | return 1; | 73 | return 1; |
| 74 | } | 74 | } |
| 75 | 75 | ||
| 76 | pPicBuf->ppPic = (PPicture*)WelsMalloc (kiSize * sizeof (PPicture), "PPicture*"); | 76 | pPicBuf->ppPic = (PPicture*)WelsMallocz (kiSize * sizeof (PPicture), "PPicture*"); |
| 77 | 77 | ||
| 78 | if (NULL == pPicBuf->ppPic) { | 78 | if (NULL == pPicBuf->ppPic) { |
| 79 | pPicBuf->iCapacity = 0; | 79 | pPicBuf->iCapacity = 0; |
| @@ -109,13 +109,13 @@ static int32_t IncreasePicBuff (PWelsDecoderContext pCtx, PPicBuff* ppPicBuf, co · 29 unmodified lines | |||
| 109 | return 1; | 109 | return 1; |
| 110 | } | 110 | } |
| 111 | 111 | ||
| 112 | pPicNewBuf = (PPicBuff)WelsMalloc (sizeof (SPicBuff), "PPicBuff"); | 112 | pPicNewBuf = (PPicBuff)WelsMallocz (sizeof (SPicBuff), "PPicBuff"); |
| 113 | 113 | ||
| 114 | if (NULL == pPicNewBuf) { | 114 | if (NULL == pPicNewBuf) { |
| 115 | return 1; | 115 | return 1; |
| 116 | } | 116 | } |
| 117 | 117 | ||
| 118 | pPicNewBuf->ppPic = (PPicture*)WelsMalloc (kiNewSize * sizeof (PPicture), "PPicture*"); | 118 | pPicNewBuf->ppPic = (PPicture*)WelsMallocz (kiNewSize * sizeof (PPicture), "PPicture*"); |
| 119 | 119 | ||
| 120 | if (NULL == pPicNewBuf->ppPic) { | 120 | if (NULL == pPicNewBuf->ppPic) { |
| 121 | pPicNewBuf->iCapacity = 0; | 121 | pPicNewBuf->iCapacity = 0; |
| @@ -171,13 +171,13 @@ static int32_t DecreasePicBuff (PWelsDecoderContext pCtx, PPicBuff* ppPicBuf, co · 49 unmodified lines | |||
| 171 | return 1; | 171 | return 1; |
| 172 | } | 172 | } |
| 173 | 173 | ||
| 174 | pPicNewBuf = (PPicBuff)WelsMalloc (sizeof (SPicBuff), "PPicBuff"); | 174 | pPicNewBuf = (PPicBuff)WelsMallocz (sizeof (SPicBuff), "PPicBuff"); |
| 175 | 175 | ||
| 176 | if (NULL == pPicNewBuf) { | 176 | if (NULL == pPicNewBuf) { |
| 177 | return 1; | 177 | return 1; |
| 178 | } | 178 | } |
| 179 | 179 | ||
| 180 | pPicNewBuf->ppPic = (PPicture*)WelsMalloc (kiNewSize * sizeof (PPicture), "PPicture*"); | 180 | pPicNewBuf->ppPic = (PPicture*)WelsMallocz (kiNewSize * sizeof (PPicture), "PPicture*"); |
| 181 | 181 | ||
| 182 | if (NULL == pPicNewBuf->ppPic) { | 182 | if (NULL == pPicNewBuf->ppPic) { |
| 183 | pPicNewBuf->iCapacity = 0; | 183 | pPicNewBuf->iCapacity = 0; |
| @@ -417,7 +417,7 @@ int32_t WelsRequestMem (PWelsDecoderContext pCtx, const int32_t kiMbWidth, const · 233 unmodified lines | |||
| 417 | pCtx->pDec = NULL; // need prefetch a new pic due to spatial size changed | 417 | pCtx->pDec = NULL; // need prefetch a new pic due to spatial size changed |
| 418 | 418 | ||
| 419 | if (pCtx->pCabacDecEngine == NULL) | 419 | if (pCtx->pCabacDecEngine == NULL) |
| 420 | pCtx->pCabacDecEngine = (SWelsCabacDecEngine*) WelsMalloc (sizeof (SWelsCabacDecEngine), "pCtx->pCabacDecEngine"); | 420 | pCtx->pCabacDecEngine = (SWelsCabacDecEngine*) WelsMallocz (sizeof (SWelsCabacDecEngine), "pCtx->pCabacDecEngine"); |
| 421 | 421 | ||
| 422 | return ERR_NONE; | 422 | return ERR_NONE; |
| 423 | } | 423 | } |
| @@ -508,7 +508,7 @@ int32_t DecoderConfigParam (PWelsDecoderContext pCtx, const SDecodingParam* kpPa · 84 unmodified lines | |||
| 508 | if (NULL == pCtx || NULL == kpParam) | 508 | if (NULL == pCtx || NULL == kpParam) |
| 509 | return 1; | 509 | return 1; |
| 510 | 510 | ||
| 511 | pCtx->pParam = (SDecodingParam*)WelsMalloc (sizeof (SDecodingParam), "SDecodingParam"); | 511 | pCtx->pParam = (SDecodingParam*)WelsMallocz (sizeof (SDecodingParam), "SDecodingParam"); |
| 512 | 512 | ||
| 513 | if (NULL == pCtx->pParam) | 513 | if (NULL == pCtx->pParam) |
| 514 | return 1; | 514 | return 1; |