diff --git a/libavformat/utils.c b/libavformat/utils.c
index a43238bd2080651e0d1702b88000dd1ffb29b282..13de68a238feb51f618d3d2340a1115788953cc1 100644
--- a/libavformat/utils.c
+++ b/libavformat/utils.c
@@ -2733,7 +2733,8 @@ int av_find_stream_info(AVFormatContext *ic)
 
 int avformat_find_stream_info(AVFormatContext *ic, AVDictionary **options)
 {
-    int i, count, ret, read_size, j;
+    int i, count, ret, j;
+    int64_t read_size;
     AVStream *st;
     AVPacket pkt1, *pkt;
     int64_t old_offset = avio_tell(ic->pb);