#endif
#include <bitset>
+#include <cstring>
#include <tdebug.h>
#include <tstringlist.h>
!d->header->encryption())
{
z_stream stream;
- memset(&stream, 0, sizeof(z_stream));
+ ::memset(&stream, 0, sizeof(z_stream));
if(inflateInit(&stream) != Z_OK)
return ByteVector();
-#include <cppunit/extensions/HelperMacros.h>
#include <string>
#include <stdio.h>
#include <tag.h>
#include <tbytevectorlist.h>
#include <aifffile.h>
+#include <cppunit/extensions/HelperMacros.h>
#include "utils.h"
using namespace std;
CPPUNIT_TEST_SUITE(TestAIFF);
CPPUNIT_TEST(testReading);
CPPUNIT_TEST(testAiffCProperties);
- CPPUNIT_TEST(testReading);
+ CPPUNIT_TEST(testFuzzedFile1);
+ CPPUNIT_TEST(testFuzzedFile2);
CPPUNIT_TEST_SUITE_END();
public:
CPPUNIT_ASSERT(f.audioProperties()->compressionName() == "SGI CCITT G.711 A-law");
}
- void testFuzzedFiles()
+ void testFuzzedFile1()
{
RIFF::AIFF::File f(TEST_FILE_PATH_C("segfault.aif"));
CPPUNIT_ASSERT(!f.isValid());
}
+ void testFuzzedFile2()
+ {
+ RIFF::AIFF::File f(TEST_FILE_PATH_C("excessive_alloc.aif"));
+ CPPUNIT_ASSERT(!f.isValid());
+ }
+
};
CPPUNIT_TEST_SUITE_REGISTRATION(TestAIFF);
CPPUNIT_TEST(testSaveID3v24WrongParam);
CPPUNIT_TEST(testSaveID3v23);
CPPUNIT_TEST(testDuplicateID3v2);
+ CPPUNIT_TEST(testFuzzedFile);
CPPUNIT_TEST_SUITE_END();
public:
CPPUNIT_ASSERT_EQUAL(44100, f.audioProperties()->sampleRate());
}
+ void testFuzzedFile()
+ {
+ MPEG::File f(TEST_FILE_PATH_C("excessive_alloc.mp3"));
+ CPPUNIT_ASSERT(f.isValid());
+ }
+
};
CPPUNIT_TEST_SUITE_REGISTRATION(TestMPEG);