[FFmpeg-cvslog] mov: Free intermediate arrays in the normal cleanup function

Martin Storsjö git at videolan.org
Tue Feb 4 06:32:05 CET 2014


ffmpeg | branch: release/1.1 | Martin Storsjö <martin at martin.st> | Mon Jan 13 14:43:23 2014 +0200| [44079902c49e526f464bb4eb855665e1af867e91] | committer: Reinhard Tartler

mov: Free intermediate arrays in the normal cleanup function

These arrays are normally freed at the end of mov_read_trak,
but make sure they're freed in case mov_read_trak returned
early (due to errors) or in case the atoms that allocate arrays
are encountered at some other point than within a trak (which
we don't have checks against).

Sample-Id: 00000496-google
Reported-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
CC: libav-stable at libav.org
Signed-off-by: Martin Storsjö <martin at martin.st>
(cherry picked from commit d51f09962d5b4bc999fb70c040f330dd1873212e)
Signed-off-by: Reinhard Tartler <siretart at tauware.de>

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

 libavformat/mov.c |    8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/libavformat/mov.c b/libavformat/mov.c
index 8c54706..6f1ea6c 100644
--- a/libavformat/mov.c
+++ b/libavformat/mov.c
@@ -2758,6 +2758,14 @@ static int mov_read_close(AVFormatContext *s)
         av_freep(&sc->drefs);
         if (sc->pb && sc->pb != s->pb)
             avio_close(sc->pb);
+
+        av_freep(&sc->chunk_offsets);
+        av_freep(&sc->stsc_data);
+        av_freep(&sc->sample_sizes);
+        av_freep(&sc->keyframes);
+        av_freep(&sc->stts_data);
+        av_freep(&sc->stps_data);
+        av_freep(&sc->rap_group);
     }
 
     if (mov->dv_demux) {



More information about the ffmpeg-cvslog mailing list