diff options
| author | Jean-Baptiste Queru <jbq@google.com> | 2012-08-08 13:15:42 -0700 |
|---|---|---|
| committer | Android Git Automerger <android-git-automerger@android.com> | 2012-08-08 13:15:42 -0700 |
| commit | 9326e74cb592cc204bba7c38960b9235c4c680cf (patch) | |
| tree | 5e5c1dd35e6e72229e2b58275eb8cea2bd9a8b90 | |
| parent | d32a2c0a9a7b199046679510ba94ae7c44f1aaa7 (diff) | |
| parent | dadf369042250e6e96a745526e8f27db3d3ce71c (diff) | |
| download | frameworks_av-9326e74cb592cc204bba7c38960b9235c4c680cf.zip frameworks_av-9326e74cb592cc204bba7c38960b9235c4c680cf.tar.gz frameworks_av-9326e74cb592cc204bba7c38960b9235c4c680cf.tar.bz2 | |
am dadf3690: am 49e74946: am 44237a8d: am b71298ee: Merge "avcenc: Initialize all memory allocated by the CBAVC_Malloc callback function"
* commit 'dadf369042250e6e96a745526e8f27db3d3ce71c':
avcenc: Initialize all memory allocated by the CBAVC_Malloc callback function
| -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 b6cd6bb..a2ef3a1 100644 --- a/media/libstagefright/codecs/avc/enc/SoftAVCEncoder.cpp +++ b/media/libstagefright/codecs/avc/enc/SoftAVCEncoder.cpp @@ -137,7 +137,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) { |
