[libav-commits] apetag: make sure avio_get_str() doesn't read more than it should.

Anton Khirnov git at libav.org
Mon Jul 2 16:22:04 CEST 2012


Module: libav
Branch: master
Commit: f2e175c7563a1cd4780586d28929de67d7b8a426

Author:    Anton Khirnov <anton at khirnov.net>
Committer: Anton Khirnov <anton at khirnov.net>
Date:      Tue Jun 26 18:49:04 2012 +0200

apetag: make sure avio_get_str() doesn't read more than it should.

---

 libavformat/apetag.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/libavformat/apetag.c b/libavformat/apetag.c
index 68c987e..e5c839e 100644
--- a/libavformat/apetag.c
+++ b/libavformat/apetag.c
@@ -59,7 +59,7 @@ static int ape_tag_read_field(AVFormatContext *s)
         AVStream *st = avformat_new_stream(s, NULL);
         if (!st)
             return AVERROR(ENOMEM);
-        avio_get_str(pb, INT_MAX, filename, sizeof(filename));
+        avio_get_str(pb, size, filename, sizeof(filename));
         st->codec->extradata = av_malloc(size + FF_INPUT_BUFFER_PADDING_SIZE);
         if (!st->codec->extradata)
             return AVERROR(ENOMEM);



More information about the libav-commits mailing list