From: Michael Niedermayer Date: Wed, 28 May 2008 00:10:34 +0000 (+0000) Subject: Fixes NULL pointer dereference CID66 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=fce88d52ca0b694a614e2cf030c3f622db65b164;p=ffmpeg Fixes NULL pointer dereference CID66 Originally committed as revision 13483 to svn://svn.ffmpeg.org/ffmpeg/trunk --- diff --git a/libavformat/avidec.c b/libavformat/avidec.c index a84acf8e283..06576c313ce 100644 --- a/libavformat/avidec.c +++ b/libavformat/avidec.c @@ -650,6 +650,9 @@ static int avi_read_packet(AVFormatContext *s, AVPacket *pkt) 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)