summaryrefslogtreecommitdiffstats
path: root/media/libstagefright/codecs/avc/enc/SoftAVCEncoder.cpp
diff options
context:
space:
mode:
authorMartin Storsjo <martin@martin.st>2012-04-16 20:50:37 +0300
committerMartin Storsjo <martin@martin.st>2012-07-12 18:19:26 +0300
commit359d8fcd30ff0a8390e4c5560d53ec55a4cc5bcd (patch)
treeefec98a8194e6be3d10aa986fbb264f869023c7b /media/libstagefright/codecs/avc/enc/SoftAVCEncoder.cpp
parent23da4cf305b9bfff07954711a8a2d9ec040865af (diff)
downloadframeworks_av-359d8fcd30ff0a8390e4c5560d53ec55a4cc5bcd.zip
frameworks_av-359d8fcd30ff0a8390e4c5560d53ec55a4cc5bcd.tar.gz
frameworks_av-359d8fcd30ff0a8390e4c5560d53ec55a4cc5bcd.tar.bz2
avcenc: Initialize all memory allocated by the CBAVC_Malloc callback function
Valgrind reported use of uninitialized memory in AVCEncodeSlice, which this fixes. Change-Id: Ia09ad3e50d05b2b0487a4d588d9b00fc0828c816
Diffstat (limited to 'media/libstagefright/codecs/avc/enc/SoftAVCEncoder.cpp')
-rw-r--r--media/libstagefright/codecs/avc/enc/SoftAVCEncoder.cpp5
1 files changed, 4 insertions, 1 deletions
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) {