Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1244)

Unified Diff: media/webm/webm_cluster_parser_unittest.cc

Issue 141013008: Report parse error for WebM clusters missing a timecode (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « media/webm/webm_cluster_parser.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/webm/webm_cluster_parser_unittest.cc
diff --git a/media/webm/webm_cluster_parser_unittest.cc b/media/webm/webm_cluster_parser_unittest.cc
index 865a274237ee16140f86ef5e27a6f79567751dd6..faf4f963c8c715d9ae64e65efa9f8d299a0c9d97 100644
--- a/media/webm/webm_cluster_parser_unittest.cc
+++ b/media/webm/webm_cluster_parser_unittest.cc
@@ -525,4 +525,24 @@ TEST_F(WebMClusterParserTest, ParseBadEncryptedBlock) {
EXPECT_EQ(-1, result);
}
+TEST_F(WebMClusterParserTest, ParseInvalidZeroSizedCluster) {
+ const uint8 kBuffer[] = {
+ 0x1F, 0x43, 0xB6, 0x75, 0x80, // CLUSTER (size = 0)
+ };
+ int size = sizeof(kBuffer);
acolwell GONE FROM CHROMIUM 2014/01/17 16:34:26 nit: just inline this since size isn't used anywhe
wolenetz 2014/01/17 18:47:55 Done.
+
+ EXPECT_EQ(parser_->Parse(kBuffer, size), -1);
+}
+
+TEST_F(WebMClusterParserTest, ParseInvalidUnknownButActuallyZeroSizedCluster) {
+ const uint8 kBuffer[] = {
+ 0x1F, 0x43, 0xB6, 0x75, 0xFF, // CLUSTER (size = "unknown")
+ 0x1F, 0x43, 0xB6, 0x75, 0x85, // CLUSTER (size = 5)
+ };
+
+ int size = sizeof(kBuffer);
acolwell GONE FROM CHROMIUM 2014/01/17 16:34:26 ditto.
wolenetz 2014/01/17 18:47:55 Done.
+
+ EXPECT_EQ(parser_->Parse(kBuffer, size), -1);
+}
+
} // namespace media
« no previous file with comments | « media/webm/webm_cluster_parser.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698