mirror of
https://github.com/taglib/taglib.git
synced 2025-07-18 21:14:23 -04:00
Merge pull request #765 from TsudaKageyu/zero-length-atom
Proper handling of MP4 atoms with zero length.
This commit is contained in:
BIN
tests/data/zero-length-mdat.m4a
Normal file
BIN
tests/data/zero-length-mdat.m4a
Normal file
Binary file not shown.
@ -58,6 +58,7 @@ class TestMP4 : public CppUnit::TestFixture
|
||||
CPPUNIT_TEST(testPropertiesMovement);
|
||||
CPPUNIT_TEST(testFuzzedFile);
|
||||
CPPUNIT_TEST(testRepeatedSave);
|
||||
CPPUNIT_TEST(testWithZeroLengthAtom);
|
||||
CPPUNIT_TEST_SUITE_END();
|
||||
|
||||
public:
|
||||
@ -448,6 +449,15 @@ public:
|
||||
CPPUNIT_ASSERT_EQUAL(2862L, f.find("0123456789"));
|
||||
CPPUNIT_ASSERT_EQUAL(-1L, f.find("0123456789", 2863));
|
||||
}
|
||||
|
||||
void testWithZeroLengthAtom()
|
||||
{
|
||||
MP4::File f(TEST_FILE_PATH_C("zero-length-mdat.m4a"));
|
||||
CPPUNIT_ASSERT(f.isValid());
|
||||
CPPUNIT_ASSERT_EQUAL(1115, f.audioProperties()->lengthInMilliseconds());
|
||||
CPPUNIT_ASSERT_EQUAL(22050, f.audioProperties()->sampleRate());
|
||||
}
|
||||
|
||||
};
|
||||
|
||||
CPPUNIT_TEST_SUITE_REGISTRATION(TestMP4);
|
||||
|
Reference in New Issue
Block a user