mirror of
https://github.com/taglib/taglib.git
synced 2025-05-27 21:20:26 -04:00
Fix reading table of contents frames with a lot of children.
This commit is contained in:
parent
d8e5077961
commit
9b995544e4
@ -272,9 +272,9 @@ void TableOfContentsFrame::parseFields(const ByteVector &data)
|
||||
int pos = 0;
|
||||
unsigned int embPos = 0;
|
||||
d->elementID = readStringField(data, String::Latin1, &pos).data(String::Latin1);
|
||||
d->isTopLevel = (data.at(pos) & 2) > 0;
|
||||
d->isOrdered = (data.at(pos++) & 1) > 0;
|
||||
unsigned int entryCount = data.at(pos++);
|
||||
d->isTopLevel = (data.at(pos) & 2) != 0;
|
||||
d->isOrdered = (data.at(pos++) & 1) != 0;
|
||||
unsigned int entryCount = static_cast<unsigned char>(data.at(pos++));
|
||||
for(unsigned int i = 0; i < entryCount; i++) {
|
||||
ByteVector childElementID = readStringField(data, String::Latin1, &pos).data(String::Latin1);
|
||||
d->childElements.append(childElementID);
|
||||
|
BIN
tests/data/toc_many_children.mp3
Normal file
BIN
tests/data/toc_many_children.mp3
Normal file
Binary file not shown.
@ -118,6 +118,7 @@ class TestID3v2 : public CppUnit::TestFixture
|
||||
CPPUNIT_TEST(testShrinkPadding);
|
||||
CPPUNIT_TEST(testEmptyFrame);
|
||||
CPPUNIT_TEST(testDuplicateTags);
|
||||
CPPUNIT_TEST(testParseTOCFrameWithManyChildren);
|
||||
CPPUNIT_TEST_SUITE_END();
|
||||
|
||||
public:
|
||||
@ -1217,6 +1218,12 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
void testParseTOCFrameWithManyChildren()
|
||||
{
|
||||
MPEG::File f(TEST_FILE_PATH_C("toc_many_children.mp3"));
|
||||
CPPUNIT_ASSERT(f.isValid());
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
CPPUNIT_TEST_SUITE_REGISTRATION(TestID3v2);
|
||||
|
Loading…
Reference in New Issue
Block a user