diff --git a/libavformat/avidec.c b/libavformat/avidec.c
index 9a2424f7bdf77dfba1d38469540782b0e0cb4323..c7a0c4044f14fdf969c938c44d3ae655d28c2d13 100644
--- a/libavformat/avidec.c
+++ b/libavformat/avidec.c
@@ -1571,7 +1571,6 @@ static int guess_ni_flag(AVFormatContext *s)
     int64_t last_start = 0;
     int64_t first_end  = INT64_MAX;
     int64_t oldpos     = avio_tell(s->pb);
-    int64_t min_pos, pos;
 
     for (i = 0; i < s->nb_streams; i++) {
         AVStream *st = s->streams[i];