diff --git a/libavformat/mp3dec.c b/libavformat/mp3dec.c
index 8dfcea23bc9f5f4c66c9d0aca0af028e5fd20458..f3079e3116ce3c5fac8121e626b4936c1440a225 100644
--- a/libavformat/mp3dec.c
+++ b/libavformat/mp3dec.c
@@ -149,6 +149,7 @@ static int mp3_read_header(AVFormatContext *s)
     // lcm of all mp3 sample rates
     avpriv_set_pts_info(st, 64, 1, 14112000);
 
+    s->pb->maxsize = -1;
     off = avio_tell(s->pb);
 
     if (!av_dict_get(s->metadata, "", NULL, AV_DICT_IGNORE_SUFFIX))