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/pic_queue.cpp (1 of 12 files). Show all
Unified · Split
| @@ -69,7 +69,7 @@ PPicture AllocPicture (PWelsDecoderContext pCtx, const int32_t kiPicWidth, const · 68 unmodified lines | ||
| 69 | 69 | int32_t iLumaSize = 0; |
| 70 | 70 | int32_t iChromaSize = 0; |
| 71 | 71 | |
| 72 | − pPic = (PPicture) WelsMalloc (sizeof (SPicture), "PPicture"); | |
| 72 | + pPic = (PPicture) WelsMallocz (sizeof (SPicture), "PPicture"); | |
| 73 | 73 | WELS_VERIFY_RETURN_IF (NULL, NULL == pPic); |
| 74 | 74 | |
| 75 | 75 | memset (pPic, 0, sizeof (SPicture)); |
| @@ -82,7 +82,7 @@ PPicture AllocPicture (PWelsDecoderContext pCtx, const int32_t kiPicWidth, const · 6 unmodified lines | ||
| 82 | 82 | iLumaSize = iPicWidth * iPicHeight; |
| 83 | 83 | iChromaSize = iPicChromaWidth * iPicChromaHeight; |
| 84 | 84 | |
| 85 | − pPic->pBuffer[0] = static_cast<uint8_t*> (WelsMalloc (iLumaSize /* luma */ | |
| 85 | + pPic->pBuffer[0] = static_cast<uint8_t*> (WelsMallocz (iLumaSize /* luma */ | |
| 86 | 86 | + (iChromaSize << 1) /* Cb,Cr */, "_pic->buffer[0]")); |
| 87 | 87 | memset (pPic->pBuffer[0], 128, (iLumaSize + (iChromaSize << 1))); |
| 88 | 88 | |