[FFmpeg-cvslog] movenc: replace cluster memset by zeroing only the needed field.

Michael Niedermayer git at videolan.org
Wed Nov 30 23:22:27 CET 2011


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Wed Nov 30 23:11:49 2011 +0100| [c863d3751f30b498c8054bd82d484156ae452803] | committer: Michael Niedermayer

movenc: replace cluster memset by zeroing only the needed field.

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

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

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

diff --git a/libavformat/movenc.c b/libavformat/movenc.c
index a1a673c..bea5c05 100644
--- a/libavformat/movenc.c
+++ b/libavformat/movenc.c
@@ -2090,11 +2090,11 @@ 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;
     trk->cluster[trk->entry].samplesInChunk = samplesInChunk;
+    trk->cluster[trk->entry].chunkNum = 0;
     trk->cluster[trk->entry].size = size;
     trk->cluster[trk->entry].entries = samplesInChunk;
     trk->cluster[trk->entry].dts = pkt->dts;



More information about the ffmpeg-cvslog mailing list