mirror of
https://github.com/taglib/taglib.git
synced 2026-04-12 17:09:50 -04:00
Move MPEG check to end of content-based detection (#1319)
MPEG::File::isSupported() scans for frame sync bytes that can appear in other files, causing them to be misidentified as MP3. This also includes a test with such a file.
This commit is contained in:
BIN
tests/data/mpeg-sync-flac.flac
Normal file
BIN
tests/data/mpeg-sync-flac.flac
Normal file
Binary file not shown.
@ -167,6 +167,7 @@ class TestFileRefDetectByContent : public CppUnit::TestFixture
|
||||
CPPUNIT_TEST(testSilence44SFlac);
|
||||
CPPUNIT_TEST(testSinewaveFlac);
|
||||
CPPUNIT_TEST(testZeroSizedPaddingFlac);
|
||||
CPPUNIT_TEST(testFLACWithMPEGSyncBytes);
|
||||
// Ogg::Speex::File
|
||||
CPPUNIT_TEST(testEmptySpx);
|
||||
// Ogg::Opus::File
|
||||
@ -326,6 +327,9 @@ public:
|
||||
void testZeroSizedPaddingFlac() {
|
||||
detectByContent<FLAC::File>("zero-sized-padding.flac");
|
||||
}
|
||||
void testFLACWithMPEGSyncBytes() {
|
||||
detectByContent<FLAC::File>("mpeg-sync-flac.flac");
|
||||
}
|
||||
|
||||
// -- Ogg::Speex::File --
|
||||
void testEmptySpx() { detectByContent<Ogg::Speex::File>("empty.spx"); }
|
||||
|
||||
Reference in New Issue
Block a user