Skip to content

Commit

Permalink
mov: Free intermediate arrays in the normal cleanup function
Browse files Browse the repository at this point in the history
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@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
  • Loading branch information
mstorsjo committed Jan 15, 2014
1 parent d0cd2a8 commit d51f099
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions libavformat/mov.c
Expand Up @@ -2829,6 +2829,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) {
Expand Down

0 comments on commit d51f099

Please sign in to comment.