avformat/avidec: Fix txts fmts parsing
authorMichael Niedermayer <michael@niedermayer.cc>
Tue, 30 May 2017 19:20:54 +0000 (21:20 +0200)
committerMichael Niedermayer <michael@niedermayer.cc>
Wed, 31 May 2017 00:32:42 +0000 (02:32 +0200)
Fixes: subtitle.avi from vlc/ticket/1162

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
libavformat/avidec.c

index 4e694fe..b6ef0ac 100644 (file)
@@ -727,7 +727,8 @@ FF_ENABLE_DEPRECATION_WARNINGS
             break;
         case MKTAG('s', 't', 'r', 'f'):
             /* stream header */
-            if (!size)
+            if (!size && (codec_type == AVMEDIA_TYPE_AUDIO ||
+                          codec_type == AVMEDIA_TYPE_VIDEO))
                 break;
             if (stream_index >= (unsigned)s->nb_streams || avi->dv_demux) {
                 avio_skip(pb, size);