[FFmpeg-cvslog] movenc: memset(0) new cluster elements after realloc()

Michael Niedermayer git at videolan.org
Wed Nov 30 15:25:25 CET 2011


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Wed Nov 30 15:01:28 2011 +0100| [4710993800edcea110087b31330d1062d1e56b0e] | committer: Michael Niedermayer

movenc: memset(0) new cluster elements after realloc()

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

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

 libavformat/movenc.c |    1 +
 1 files changed, 1 insertions(+), 0 deletions(-)

diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index 5820af2..a1a673c 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -2090,6 +2090,7 @@ int ff_mov_write_packet(AVFormatContext *s, AVPacket *pkt)
         trk->cluster = av_realloc_f(trk->cluster, sizeof(*trk->cluster), (trk->entry + MOV_INDEX_CLUSTER_SIZE));
         if (!trk->cluster)
             return -1;
+        memset(trk->cluster + trk->entry, 0, sizeof(*trk->cluster)*MOV_INDEX_CLUSTER_SIZE);
     }
 
     trk->cluster[trk->entry].pos = avio_tell(pb) - size;



More information about the ffmpeg-cvslog mailing list