PropertyMap Ogg::FLAC::File::setProperties(const PropertyMap &properties)
{
return d->comment->setProperties(properties);
-}
+}
Properties *Ogg::FLAC::File::audioProperties() const
{
}
- header = metadataHeader.mid(0,4);
+ header = metadataHeader.mid(0, 4);
+ if(header.size() < 4) {
+ debug("Ogg::FLAC::File::scan() -- Invalid Ogg/FLAC metadata header");
+ return;
+ }
+
// Header format (from spec):
// <1> Last-metadata-block flag
// <7> BLOCK_TYPE
{
CPPUNIT_TEST_SUITE(TestOggFLAC);
CPPUNIT_TEST(testFramingBit);
+ CPPUNIT_TEST(testFuzzedFile);
CPPUNIT_TEST_SUITE_END();
public:
delete f;
}
+ void testFuzzedFile()
+ {
+ Ogg::FLAC::File f(TEST_FILE_PATH_C("segfault.oga"));
+ CPPUNIT_ASSERT(!f.isValid());
+ }
+
};
CPPUNIT_TEST_SUITE_REGISTRATION(TestOggFLAC);