From 695fb5ec16e32f43495813ef21a60c31d1e9b992 Mon Sep 17 00:00:00 2001 From: Tsuda Kageyu Date: Tue, 23 Dec 2014 20:26:32 +0900 Subject: [PATCH] Add a test for fuzzed WAV files. --- tests/data/infloop.wav | Bin 0 -> 14272 bytes tests/test_wav.cpp | 9 ++++++++- 2 files changed, 8 insertions(+), 1 deletion(-) create mode 100644 tests/data/infloop.wav diff --git a/tests/data/infloop.wav b/tests/data/infloop.wav new file mode 100644 index 0000000000000000000000000000000000000000..c220baa8f52a0e69f02d91a20e360ff4d1d9fb41 GIT binary patch literal 14272 zcmeHuXIz_Cx+haIH%^-*w&OVNz2RPQ#Rl78FbE^l1VREK1S&|V_uf0|712fS9Rs#8 z?!Ck<9;ZyojVF`2nLB&itoM24y}O_G!~L+o{jzVIpY@*doTvPsa?W{uCiTRLhP`od zxkq!36RE7_AI8PS{R;m3Xj5G5|6j$u9Y?^k@V|jEvj4&(SE=M89*ZZED^(i3#p(3A zofe};CZv-qD#$bjjV$yIT^tR|>2#&jAt&TyBppsnOrg}>{o%!sj!vPAl=PhRjI`9$ z6cnf9(GM>NWJElX&LX1Hv$D{6=tAYdqi>)0$SOz_j*yH-<>VFO@f6$Siyxl%%E=Ul zNXE!V=j9jTOKJA=FMmWvR?tN!uYSDhBtfH6#lmH0p-@@*^x%yjzP;ikqH#>Ql7)pf zR8}D)c;m9!;i~k@HY#CsI&E+r=M$deqEB=R>2MhRMoEO+^t*li&XI zxRsNiPmyV4(1=P;%O)BpzJB$%gI|cD%Z*Ap(wLr2GLC=!)3YuK4og>>RDhB6)U+(3 ze*8;llwk|$DvOR;2&<=L5p*LjUjc6NvPlx7ih)T_PE1V2%KM)qjpz(KU#DSVq48i+ zo~Y~jtLOa^bUK!$((y~P(~=TTV4(4rZzpwF6po`aN-FYEX~`-1{Pt(R{5WGHpm8jf zUIdNlCsOk`jgS8F!>oe@x>M>zr2Opkl(al%G_35Cq35L@O-#xL%OR?#W#`c~b|VX$k(`)>qIj>qQGFI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t&A$o9mZ)hTt0|WuIDzyqw1*^ZYl2HfJN)RY=L7|9=0E_=8 zPywUh@qB?;p$5l{(G((l0?r}NffW#|0HX#qCKE8;C$fEh(ZxeizP8e z)j9;q01rWo8MRiULbMIyg3@3KHSGDo_#BV{0v4DBp$Wrd3nFO=S`gL6oEGE*!XUgs zuZE}q))gSw0>C1SBG5-@!i_k>D9{wjW3C9t>TeJV!fPNjBK(2P-sm1-6Zs8R(keu- zatwwL)e!h17Ucgn4jfnq-~wH9Am|{=gX18Mgjiky+EySm0SAbl)G7qxfL4J7zzb;y zYzKo8141Z~iX{+yfKe$z6X6UD2;kM4OaKx4xIWU;1Y;&0fw*!qIy6q zf=)CjLD{eSO9a7kn@J7{*C29H3$Q5G#ZoX4N1gg0DgE7g(5*bwg`-k>HZB- zL`{GgWF_P;=z3#egq_$(SQI*AGmxPOIb`=16BC9a3;_c%>jNAR*v2#u{m=s|BUKrq zkQi)`!N9vB_7c-|Or39*M+A)lEG8wwI`aBvDAM=li2*#O6`+dX9f1b2JfcKI3$Z7* z%K!?&p3%(|DC1$*KXZ5|F2s&I-UkAok@nze&V+6-nwJg)`W!R{{y(9T897t literal 0 HcmV?d00001 diff --git a/tests/test_wav.cpp b/tests/test_wav.cpp index 518f37cf..b0073ebc 100644 --- a/tests/test_wav.cpp +++ b/tests/test_wav.cpp @@ -15,6 +15,7 @@ class TestWAV : public CppUnit::TestFixture CPPUNIT_TEST(testLength); CPPUNIT_TEST(testZeroSizeDataChunk); CPPUNIT_TEST(testStripTags); + CPPUNIT_TEST(testFuzzedFiles); CPPUNIT_TEST_SUITE_END(); public: @@ -67,7 +68,13 @@ public: CPPUNIT_ASSERT(!f->hasID3v2Tag()); CPPUNIT_ASSERT(f->hasInfoTag()); delete f; - } + } + + void testFuzzedFiles() + { + RIFF::WAV::File f(TEST_FILE_PATH_C("infloop.wav")); + CPPUNIT_ASSERT(!f.isValid()); + } }; -- 2.40.0