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

Side by Side 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 unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « media/webm/webm_cluster_parser.cc ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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
OLDNEW
« 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