[FFmpeg-cvslog] h264: use av_fast_padded_malloc()

Michael Niedermayer git at videolan.org
Sun Feb 19 04:01:04 CET 2012


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sun Feb 19 03:47:52 2012 +0100| [e98a76d3c293f8d125c24df8b06c42f23972e93b] | committer: Michael Niedermayer

h264: use av_fast_padded_malloc()

This zeros all the memory once and avoids valgrind warnings.
alternatively the warnings could be suppressed.

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=e98a76d3c293f8d125c24df8b06c42f23972e93b
---

 libavcodec/h264.c |    4 +---
 1 files changed, 1 insertions(+), 3 deletions(-)

diff --git a/libavcodec/h264.c b/libavcodec/h264.c
index 3b74e25..e1d8c5f 100644
--- a/libavcodec/h264.c
+++ b/libavcodec/h264.c
@@ -179,10 +179,8 @@ const uint8_t *ff_h264_decode_nal(H264Context *h, const uint8_t *src, int *dst_l
 
     bufidx = h->nal_unit_type == NAL_DPC ? 1 : 0; // use second escape buffer for inter data
     si=h->rbsp_buffer_size[bufidx];
-    av_fast_malloc(&h->rbsp_buffer[bufidx], &h->rbsp_buffer_size[bufidx], length+FF_INPUT_BUFFER_PADDING_SIZE+MAX_MBPAIR_SIZE);
+    av_fast_padded_malloc(&h->rbsp_buffer[bufidx], &h->rbsp_buffer_size[bufidx], length+MAX_MBPAIR_SIZE);
     dst= h->rbsp_buffer[bufidx];
-    if(si != h->rbsp_buffer_size[bufidx])
-        memset(dst + length, 0, FF_INPUT_BUFFER_PADDING_SIZE+MAX_MBPAIR_SIZE);
 
     if (dst == NULL){
         return NULL;



More information about the ffmpeg-cvslog mailing list