avformat/mov: Fix deallocation when MOVStreamContext failed to allocate

Fixes: 260813283176b57b3c9974fe284eebc3_signal_sigsegv_7ffff713351a_991_xtrem_e2_m64q15_a32sxx.3gp with memlimit of 262144

Found-by: Samuel Groß, Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
(cherry picked from commit 15629129dd)

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Michael Niedermayer 2015-07-14 14:14:16 +02:00
parent 77eddee375
commit e604662d04
1 changed files with 3 additions and 0 deletions

View File

@ -3853,6 +3853,9 @@ static int mov_read_close(AVFormatContext *s)
AVStream *st = s->streams[i]; AVStream *st = s->streams[i];
MOVStreamContext *sc = st->priv_data; MOVStreamContext *sc = st->priv_data;
if (!sc)
continue;
av_freep(&sc->ctts_data); av_freep(&sc->ctts_data);
for (j = 0; j < sc->drefs_count; j++) { for (j = 0; j < sc->drefs_count; j++) {
av_freep(&sc->drefs[j].path); av_freep(&sc->drefs[j].path);