Do not read strd chunk in avi files as H264 extradata.
authorCarl Eugen Hoyos <cehoyos@ag.or.at>
Mon, 13 May 2013 10:39:44 +0000 (12:39 +0200)
committerCarl Eugen Hoyos <cehoyos@ag.or.at>
Mon, 13 May 2013 12:25:11 +0000 (14:25 +0200)
Fixes ticket #2561.
(cherry picked from commit 231b3317184790b6be4b4619d96fd328f13aeabb)

libavformat/avidec.c

index 00ac3de..18e2d96 100644 (file)
@@ -706,7 +706,9 @@ static int avi_read_header(AVFormatContext *s)
             }
             break;
         case MKTAG('s', 't', 'r', 'd'):
-            if (stream_index >= (unsigned)s->nb_streams || s->streams[stream_index]->codec->extradata_size) {
+            if (stream_index >= (unsigned)s->nb_streams
+                || s->streams[stream_index]->codec->extradata_size
+                || s->streams[stream_index]->codec->codec_tag == MKTAG('H','2','6','4')) {
                 avio_skip(pb, size);
             } else {
                 uint64_t cur_pos = avio_tell(pb);