Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #include <algorithm> | 5 #include <algorithm> |
| 6 | 6 |
| 7 #include "base/bind.h" | 7 #include "base/bind.h" |
| 8 #include "base/logging.h" | 8 #include "base/logging.h" |
| 9 #include "media/base/decrypt_config.h" | 9 #include "media/base/decrypt_config.h" |
| 10 #include "media/webm/cluster_builder.h" | 10 #include "media/webm/cluster_builder.h" |
| (...skipping 507 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 518 kVideoTrackNum, | 518 kVideoTrackNum, |
| 519 WebMTracksParser::TextTracks(), | 519 WebMTracksParser::TextTracks(), |
| 520 std::set<int64>(), | 520 std::set<int64>(), |
| 521 std::string(), | 521 std::string(), |
| 522 "video_key_id", | 522 "video_key_id", |
| 523 LogCB())); | 523 LogCB())); |
| 524 int result = parser_->Parse(cluster->data(), cluster->size()); | 524 int result = parser_->Parse(cluster->data(), cluster->size()); |
| 525 EXPECT_EQ(-1, result); | 525 EXPECT_EQ(-1, result); |
| 526 } | 526 } |
| 527 | 527 |
| 528 TEST_F(WebMClusterParserTest, ParseInvalidZeroSizedCluster) { | |
| 529 const uint8 kBuffer[] = { | |
| 530 0x1F, 0x43, 0xB6, 0x75, 0x80, // CLUSTER (size = 0) | |
| 531 }; | |
| 532 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.
| |
| 533 | |
| 534 EXPECT_EQ(parser_->Parse(kBuffer, size), -1); | |
| 535 } | |
| 536 | |
| 537 TEST_F(WebMClusterParserTest, ParseInvalidUnknownButActuallyZeroSizedCluster) { | |
| 538 const uint8 kBuffer[] = { | |
| 539 0x1F, 0x43, 0xB6, 0x75, 0xFF, // CLUSTER (size = "unknown") | |
| 540 0x1F, 0x43, 0xB6, 0x75, 0x85, // CLUSTER (size = 5) | |
| 541 }; | |
| 542 | |
| 543 int size = sizeof(kBuffer); | |
|
acolwell GONE FROM CHROMIUM
2014/01/17 16:34:26
ditto.
wolenetz
2014/01/17 18:47:55
Done.
| |
| 544 | |
| 545 EXPECT_EQ(parser_->Parse(kBuffer, size), -1); | |
| 546 } | |
| 547 | |
| 528 } // namespace media | 548 } // namespace media |
| OLD | NEW |