mirror of
https://github.com/taglib/taglib.git
synced 2025-07-18 21:14:23 -04:00
Be more paranoid about checking MP4 files
To consider something a valid MP4 file, it must have a 'moov' atom. Otherwise it's marked as invalid and we won't try to read/write tags. CCBUG:216819 git-svn-id: svn://anonsvn.kde.org/home/kde/trunk/kdesupport/taglib@1062426 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
This commit is contained in:
@ -16,6 +16,7 @@ class TestMP4 : public CppUnit::TestFixture
|
||||
CPPUNIT_TEST_SUITE(TestMP4);
|
||||
CPPUNIT_TEST(testProperties);
|
||||
CPPUNIT_TEST(testFreeForm);
|
||||
CPPUNIT_TEST(testCheckValid);
|
||||
CPPUNIT_TEST(testUpdateStco);
|
||||
CPPUNIT_TEST(testSaveExisingWhenIlstIsLast);
|
||||
CPPUNIT_TEST(test64BitAtom);
|
||||
@ -36,6 +37,14 @@ public:
|
||||
CPPUNIT_ASSERT_EQUAL(16, ((MP4::Properties *)f.audioProperties())->bitsPerSample());
|
||||
}
|
||||
|
||||
void testCheckValid()
|
||||
{
|
||||
MP4::File f("data/empty.aiff");
|
||||
CPPUNIT_ASSERT(!f.isValid());
|
||||
MP4::File f2("data/has-tags.m4a");
|
||||
CPPUNIT_ASSERT(f2.isValid());
|
||||
}
|
||||
|
||||
void testUpdateStco()
|
||||
{
|
||||
ScopedFileCopy copy("no-tags", ".3g2");
|
||||
|
Reference in New Issue
Block a user