From 61543432c0d9f31ff65d8c6793bd8208cc64440f Mon Sep 17 00:00:00 2001 From: Tsuda Kageyu Date: Tue, 23 Dec 2014 20:58:36 +0900 Subject: [PATCH] Fix an excessive loop when parsing an APE file. --- taglib/ape/apetag.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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));