summaryrefslogtreecommitdiffstats
path: root/media/libstagefright/codecs/avc
diff options
context:
space:
mode:
authorJean-Baptiste Queru <jbq@google.com>2012-08-08 13:08:15 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2012-08-08 13:08:15 -0700
commit44237a8d58dc218257687f2cbe8fd33d73a713e8 (patch)
treeadb18ef017ae629be478eee1e3eff62aa51547e2 /media/libstagefright/codecs/avc
parent68d44b061e92fb6832240457d4f683635bf5328f (diff)
parentb71298eeeb16d942dd5144e550731e6e29b6436e (diff)
downloadframeworks_av-44237a8d58dc218257687f2cbe8fd33d73a713e8.zip
frameworks_av-44237a8d58dc218257687f2cbe8fd33d73a713e8.tar.gz
frameworks_av-44237a8d58dc218257687f2cbe8fd33d73a713e8.tar.bz2
am b71298ee: Merge "avcenc: Initialize all memory allocated by the CBAVC_Malloc callback function"
* commit 'b71298eeeb16d942dd5144e550731e6e29b6436e': avcenc: Initialize all memory allocated by the CBAVC_Malloc callback function
Diffstat (limited to 'media/libstagefright/codecs/avc')
-rw-r--r--media/libstagefright/codecs/avc/common/include/avcapi_common.h2
-rw-r--r--media/libstagefright/codecs/avc/enc/SoftAVCEncoder.cpp5
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) {