diff --git a/libavformat/utils.c b/libavformat/utils.c index 59ee8df8bb..ddcf09ebb1 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -1279,7 +1279,7 @@ static int av_seek_frame_generic(AVFormatContext *s, index = av_index_search_timestamp(st, timestamp, flags); - if(index < 0){ + if(index < 0 || index==st->nb_index_entries-1){ int i; AVPacket pkt;