diff --git a/libavformat/nutdec.c b/libavformat/nutdec.c index ba3eb859f2..3389c79ba9 100644 --- a/libavformat/nutdec.c +++ b/libavformat/nutdec.c @@ -950,6 +950,8 @@ static int read_seek(AVFormatContext *s, int stream_index, if (st->index_entries) { int index = av_index_search_timestamp(st, pts, flags); + if (index < 0) + index = av_index_search_timestamp(st, pts, flags ^ AVSEEK_FLAG_BACKWARD); if (index < 0) return -1;