mirror of
https://github.com/taglib/taglib.git
synced 2025-07-18 21:14:23 -04:00
Be tolerant of empty FLAC seektable blocks.
This commit is contained in:
BIN
tests/data/empty-seektable.flac
Normal file
BIN
tests/data/empty-seektable.flac
Normal file
Binary file not shown.
@ -63,6 +63,7 @@ class TestFLAC : public CppUnit::TestFixture
|
||||
CPPUNIT_TEST(testEmptyID3v2);
|
||||
CPPUNIT_TEST(testStripTags);
|
||||
CPPUNIT_TEST(testRemoveXiphField);
|
||||
CPPUNIT_TEST(testEmptySeekTable);
|
||||
CPPUNIT_TEST_SUITE_END();
|
||||
|
||||
public:
|
||||
@ -516,6 +517,24 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
void testEmptySeekTable()
|
||||
{
|
||||
ScopedFileCopy copy("empty-seektable", ".flac");
|
||||
{
|
||||
FLAC::File f(copy.fileName().c_str());
|
||||
CPPUNIT_ASSERT(f.isValid());
|
||||
f.xiphComment(true)->setTitle("XiphComment Title");
|
||||
f.save();
|
||||
}
|
||||
{
|
||||
FLAC::File f(copy.fileName().c_str());
|
||||
CPPUNIT_ASSERT(f.isValid());
|
||||
f.seek(42);
|
||||
const ByteVector data = f.readBlock(4);
|
||||
CPPUNIT_ASSERT_EQUAL(ByteVector("\x03\x00\x00\x00", 4), data);
|
||||
}
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
CPPUNIT_TEST_SUITE_REGISTRATION(TestFLAC);
|
||||
|
Reference in New Issue
Block a user