Fix an excessive loop when parsing an APE file.

This commit is contained in:
Tsuda Kageyu 2014-12-23 20:58:36 +09:00
parent 4a9614bfc3
commit 61543432c0

View File

@ -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));