From: Tsuda Kageyu Date: Tue, 23 Dec 2014 11:58:36 +0000 (+0900) Subject: Fix an excessive loop when parsing an APE file. X-Git-Tag: v1.10beta~133^2~1 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=61543432c0d9f31ff65d8c6793bd8208cc64440f;p=taglib Fix an excessive loop when parsing an APE file. --- diff --git a/taglib/ape/apetag.cpp b/taglib/ape/apetag.cpp index e1252193..22471d40 100644 --- a/taglib/ape/apetag.cpp +++ b/taglib/ape/apetag.cpp @@ -368,10 +368,13 @@ ByteVector APE::Tag::render() const void APE::Tag::parse(const ByteVector &data) { - uint pos = 0; - // 11 bytes is the minimum size for an APE item + if(data.size() < 11) + return; + + uint pos = 0; + for(uint i = 0; i < d->footer.itemCount() && pos <= data.size() - 11; i++) { APE::Item item; item.parse(data.mid(pos));