From d46db490b1ee887be0804572e6598291bb3fa47d Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Thu, 24 Mar 2005 21:27:54 +0000 Subject: [PATCH] segfault fix Originally committed as revision 4079 to svn://svn.ffmpeg.org/ffmpeg/trunk --- libavformat/avidec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libavformat/avidec.c b/libavformat/avidec.c index bba0237903..058c88692c 100644 --- a/libavformat/avidec.c +++ b/libavformat/avidec.c @@ -451,7 +451,7 @@ resync: index= av_index_search_timestamp(st, pkt->dts, 0); e= &st->index_entries[index]; - if(e->timestamp == ast->frame_offset){ + if(index >= 0 && e->timestamp == ast->frame_offset){ if (e->flags & AVINDEX_KEYFRAME) pkt->flags |= PKT_FLAG_KEY; }