mov: fix self referencing timecode tracks

Fixes read after free.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
Michael Niedermayer 2013-02-20 15:45:50 +01:00
parent 951d39fecd
commit 2ccaab9709
1 changed files with 1 additions and 1 deletions

View File

@ -3173,7 +3173,7 @@ static int mov_read_header(AVFormatContext *s)
if (s->streams[j]->id == sc->timecode_track)
tmcd_st_id = j;
if (tmcd_st_id < 0)
if (tmcd_st_id < 0 || tmcd_st_id == i)
continue;
tcr = av_dict_get(s->streams[tmcd_st_id]->metadata, "timecode", NULL, 0);
if (tcr)