Fixes NULL pointer dereference CID66
authorMichael Niedermayer <michaelni@gmx.at>
Wed, 28 May 2008 00:10:34 +0000 (00:10 +0000)
committerMichael Niedermayer <michaelni@gmx.at>
Wed, 28 May 2008 00:10:34 +0000 (00:10 +0000)
Originally committed as revision 13483 to svn://svn.ffmpeg.org/ffmpeg/trunk

libavformat/avidec.c

index a84acf8..06576c3 100644 (file)
@@ -650,6 +650,9 @@ static int avi_read_packet(AVFormatContext *s, AVPacket *pkt)
                 best_stream_index= i;
             }
         }
                 best_stream_index= i;
             }
         }
+        if(!best_st)
+            return -1;
+
         best_ast = best_st->priv_data;
         best_ts= av_rescale(best_ts, best_st->time_base.den, AV_TIME_BASE * (int64_t)best_st->time_base.num); //FIXME a little ugly
         if(best_ast->remaining)
         best_ast = best_st->priv_data;
         best_ts= av_rescale(best_ts, best_st->time_base.den, AV_TIME_BASE * (int64_t)best_st->time_base.num); //FIXME a little ugly
         if(best_ast->remaining)