diff options
author | Jean-Baptiste Queru <jbq@google.com> | 2012-08-08 12:08:44 -0700 |
---|---|---|
committer | android code review <noreply-gerritcodereview@google.com> | 2012-08-08 12:08:45 -0700 |
commit | b71298eeeb16d942dd5144e550731e6e29b6436e (patch) | |
tree | d139330ca50b2ed5a2404560877f6e22319959db /media/libstagefright/codecs | |
parent | 0ab18f853571149de700930fbb783ecd6b2c5582 (diff) | |
parent | 359d8fcd30ff0a8390e4c5560d53ec55a4cc5bcd (diff) | |
download | frameworks_av-b71298eeeb16d942dd5144e550731e6e29b6436e.zip frameworks_av-b71298eeeb16d942dd5144e550731e6e29b6436e.tar.gz frameworks_av-b71298eeeb16d942dd5144e550731e6e29b6436e.tar.bz2 |
Merge "avcenc: Initialize all memory allocated by the CBAVC_Malloc callback function"
Diffstat (limited to 'media/libstagefright/codecs')
-rw-r--r-- | media/libstagefright/codecs/avc/common/include/avcapi_common.h | 2 | ||||
-rw-r--r-- | media/libstagefright/codecs/avc/enc/SoftAVCEncoder.cpp | 5 |
2 files changed, 5 insertions, 2 deletions
diff --git a/media/libstagefright/codecs/avc/common/include/avcapi_common.h b/media/libstagefright/codecs/avc/common/include/avcapi_common.h index 001c1a1..abffe6e 100644 --- a/media/libstagefright/codecs/avc/common/include/avcapi_common.h +++ b/media/libstagefright/codecs/avc/common/include/avcapi_common.h @@ -213,7 +213,7 @@ typedef void (*FuctionType_FrameUnbind)(void *userData, int); memory usage. \param "size" "Size of requested memory in bytes." \param "attribute" "Some value specifying types, priority, etc. of the memory." -\return "The address of the allocated memory" +\return "The address of the allocated, zero-initialized memory" */ typedef void* (*FunctionType_Malloc)(void *userData, int32 size, int attribute); diff --git a/media/libstagefright/codecs/avc/enc/SoftAVCEncoder.cpp b/media/libstagefright/codecs/avc/enc/SoftAVCEncoder.cpp index 9fedace..259562b 100644 --- a/media/libstagefright/codecs/avc/enc/SoftAVCEncoder.cpp +++ b/media/libstagefright/codecs/avc/enc/SoftAVCEncoder.cpp @@ -133,7 +133,10 @@ inline static void ConvertYUV420SemiPlanarToYUV420Planar( static void* MallocWrapper( void *userData, int32_t size, int32_t attrs) { - return malloc(size); + void *ptr = malloc(size); + if (ptr) + memset(ptr, 0, size); + return ptr; } static void FreeWrapper(void *userData, void* ptr) { |