avformat/avidec: Dont assert the existence of an index for video streams.
authorMichael Niedermayer <michaelni@gmx.at>
Fri, 22 Nov 2013 14:08:04 +0000 (15:08 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Tue, 7 Jan 2014 23:25:02 +0000 (00:25 +0100)
Its possible in various rare cases that an index cannot be created or allocated.
Fixes assertion failure
Fixes: signal_sigabrt_7ffff7126425_7712_pokem.avi

Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
(cherry picked from commit 7865759409b27089b444bc029b2b76b06161b2cf)

Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavformat/avidec.c

index 1a40e94..81f4b18 100644 (file)
@@ -1306,10 +1306,9 @@ FF_ENABLE_DEPRECATION_WARNINGS
                     size);
             pkt->stream_index = avi->stream_index;
 
-            if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO) {
+            if (st->codec->codec_type == AVMEDIA_TYPE_VIDEO && st->index_entries) {
                 AVIndexEntry *e;
                 int index;
-                av_assert0(st->index_entries);
 
                 index = av_index_search_timestamp(st, ast->frame_offset, 0);
                 e     = &st->index_entries[index];