diff options
author | Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com> | 2015-05-26 14:24:36 +0100 |
---|---|---|
committer | Luca Barbato <lu_zero@gentoo.org> | 2015-05-31 13:05:12 +0200 |
commit | f261a55d72753bcec33369954809732abae8f8f7 (patch) | |
tree | 9c5318e6521540371b1f85792824683bfa4a3e6f | |
parent | 3f38d4b816b2aeca15c0b90000ea7ed40377eb0c (diff) | |
download | ffmpeg-streaming-f261a55d72753bcec33369954809732abae8f8f7.zip ffmpeg-streaming-f261a55d72753bcec33369954809732abae8f8f7.tar.gz |
mov: Fix two memleaks
Signed-off-by: Andreas Cadhalpun <Andreas.Cadhalpun@googlemail.com>
Signed-off-by: Luca Barbato <lu_zero@gentoo.org>
CC: libav-stable@libav.org
-rw-r--r-- | libavformat/mov.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/libavformat/mov.c b/libavformat/mov.c index 70fa1e0..33e1054 100644 --- a/libavformat/mov.c +++ b/libavformat/mov.c @@ -1942,10 +1942,11 @@ static int mov_read_stsz(MOVContext *c, AVIOContext *pb, MOVAtom atom) sc->sample_count = i; + av_free(buf); + if (pb->eof_reached) return AVERROR_EOF; - av_free(buf); return 0; } @@ -2028,6 +2029,8 @@ static int mov_read_ctts(MOVContext *c, AVIOContext *pb, MOVAtom atom) av_log(c->fc, AV_LOG_TRACE, "track[%i].ctts.entries = %i\n", c->fc->nb_streams-1, entries); + av_freep(&sc->ctts_data); + if (!entries) return 0; if (entries >= UINT_MAX / sizeof(*sc->ctts_data)) |