From 1de8d4cb4f3a76fc532684c3cfac17923628c4c5 Mon Sep 17 00:00:00 2001 From: Tom Finegan Date: Fri, 19 Aug 2016 12:13:14 -0700 Subject: [PATCH] parser_tests: Add truncated chapter string test. Change-Id: I1714fbfea5bab61cca61cd32a0a0d30315ed56fc --- testing/parser_tests.cc | 10 ++++++++++ testing/testdata/invalid/README.libwebm | 5 +++++ .../chapters_truncated_chapter_string.mkv | Bin 0 -> 6993 bytes 3 files changed, 15 insertions(+) create mode 100644 testing/testdata/invalid/chapters_truncated_chapter_string.mkv diff --git a/testing/parser_tests.cc b/testing/parser_tests.cc index b27f63a..82bc552 100644 --- a/testing/parser_tests.cc +++ b/testing/parser_tests.cc @@ -693,6 +693,16 @@ TEST_F(ParserTest, Vp9CodecPrivateBadTest) { kCodecPrivateLength, NULL)); } +TEST_F(ParserTest, InvalidTruncatedChapterString) { + filename_ = GetTestFilePath("invalid/chapters_truncated_chapter_string.mkv"); + ASSERT_NE(0u, filename_.length()); + ASSERT_EQ(0, reader_.Open(filename_.c_str())); + mkvparser::EBMLHeader ebml_header; + ASSERT_EQ(0, ebml_header.Parse(&reader_, pos_)); + ASSERT_EQ(0, mkvparser::Segment::CreateInstance(&reader_, pos_, segment_)); + EXPECT_EQ(mkvparser::E_PARSE_FAILED, segment_->Load()); +} + TEST_F(ParserTest, InvalidFixedLacingSize) { filename_ = GetTestFilePath("invalid/fixed_lacing_bad_lace_size.mkv"); ASSERT_NE(0u, filename_.length()); diff --git a/testing/testdata/invalid/README.libwebm b/testing/testdata/invalid/README.libwebm index 51fadf6..a8a7804 100644 --- a/testing/testdata/invalid/README.libwebm +++ b/testing/testdata/invalid/README.libwebm @@ -1,5 +1,10 @@ Why the files in this directory are considered invalid: +chapters_truncated_chapter_string.mkv - File with a Chapters element that ends + with a ChapterAtom whose ChapterDisplay + element contains a truncated + ChapterString. + fixed_lacing_bad_lace_size.mkv - File containing a BlockGroup with fixed lacing, but reports a total laced size that is not evenly divisible by the number of laced diff --git a/testing/testdata/invalid/chapters_truncated_chapter_string.mkv b/testing/testdata/invalid/chapters_truncated_chapter_string.mkv new file mode 100644 index 0000000000000000000000000000000000000000..9883e77808af3dbf53436f2c1fca11814812d6b9 GIT binary patch literal 6993 zcmeHLeQXnD9KP!&m}X<3LBK4_E4U1y9`Aki=%JzOR>lm=rtM}lWaHXiw}y7b_PX$) zp|^Hrkm;x(5?C}c9Ws_VgP?PKiTDKpKN78ppNK>ZA2L4@O^oq(8%VDSB>q9r3etW-RbIoHyRR!#%iM>kie7JOxz^=o(0NeO6R3o+x&WKt0*@>503>513rB za|IkQt^R!N0I>hZw&H8)x&K-PBX2lhIB;VeaNZbNgVk{0ra4e@(?&K1HXJY^1S;V8A1LLP6AqDS;BuTm*?Lj}Wxvd*xzfE~|`rC`w97;CE4lU?4YfmK{ zJ%je{j7mn|Ngk*^Ju{(_!z$USlJ)&6(W4TfA5?M{U7K7OCy4rsDv|1LXsW4mR&n#H zUA6Pd8!Gx$(!1kj(nqj=og!v5Lmc3~v%hv*i=80y2-p?$zFXi~MiTig7xxd%I-N+G zJdYAH_x2=Wt-f!c8EQ9u^k%!szD*_EL+$y5Tk8y-%%~<1H1Us;tqIkXEr3oxpl0HBn2&TE^;GxZJk*Ogk%)<`=c^IvDqJv zcx4}o#yrt+rWG)xqQIz<#9=IhjIr%%^!v1CK^!gkIog6`iDqPv1^FevpOye;<9&kF zf&{PDppLZ$eN6i?3w1$Yu>kX-We*McD|{XsFR;7?c{!QpXtOsKRl*_U4F|)KacLH$ zL;}8*pc*#7U9NCE#vBKF1c)#$XM;E&q6ea6*4BYPB8TEzJoZg>v`W-5Dp|)u`s*>@|9bFiUV=oG>Lluu}cY=Mp0a(<3yguF0K0L7`o&&at3{AmxDhs^QQ~hze z<5(trYYsEbi7ZXQo%b?$0GRuJwT`A!B%Zx)S`IZsi=35W|Do2<$4a>%pu0;)y6t)) z%zTmMD3;-~xEl}U%>eYdP1TR&C}DY#rYTmZB>u$ls&vZq(9}2f9M*GljHa6xu5!;x zu3A=j8qh1dVj*jpXr3I2{<$=rx~1sn z)-Q9=EGV&3Sf_hKjDSO6H|3c08NW5 frWD;QZQFktNT((ies%kUS=