mov: fix self referencing timecode tracks
authorMichael Niedermayer <michaelni@gmx.at>
Wed, 20 Feb 2013 14:45:50 +0000 (15:45 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Wed, 20 Feb 2013 14:46:33 +0000 (15:46 +0100)
Fixes read after free.

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavformat/mov.c

index 5575b82..86ec95c 100644 (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)