parser_tests: Add truncated chapter string test.

Change-Id: I1714fbfea5bab61cca61cd32a0a0d30315ed56fc
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 @@
                                              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 0000000..9883e77
--- /dev/null
+++ b/testing/testdata/invalid/chapters_truncated_chapter_string.mkv
Binary files differ