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

Unified Diff: media/formats/mp4/track_run_iterator_unittest.cc

Issue 540503003: Fix TrackRunIterator to generate a parse error when it encounters a reserved dependency value. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 6 years, 3 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/formats/mp4/track_run_iterator.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/formats/mp4/track_run_iterator_unittest.cc
diff --git a/media/formats/mp4/track_run_iterator_unittest.cc b/media/formats/mp4/track_run_iterator_unittest.cc
index 9caba620d39601040d30da300634734f934e4971..d1d6e078eaefeecb237fd3e2f411c3eb4aa0198c 100644
--- a/media/formats/mp4/track_run_iterator_unittest.cc
+++ b/media/formats/mp4/track_run_iterator_unittest.cc
@@ -108,6 +108,9 @@ class TrackRunIteratorTest : public testing::Test {
case 'N':
sample_depends_on = kSampleDependsOnNoOther;
break;
+ case 'R':
+ sample_depends_on = kSampleDependsOnReserved;
+ break;
default:
CHECK(false) << "Invalid sample dependency character '"
<< str[0] << "'";
@@ -369,6 +372,25 @@ TEST_F(TrackRunIteratorTest, FirstSampleFlagTest) {
EXPECT_EQ("2 KR P P P P P P P P P", KeyframeAndRAPInfo(iter_.get()));
}
+// Verify that parsing fails if a reserved value is in the sample flags.
+TEST_F(TrackRunIteratorTest, SampleInfoTest_ReservedInSampleFlags) {
+ iter_.reset(new TrackRunIterator(&moov_, log_cb_));
+ MovieFragment moof = CreateFragment();
+ // Change the "depends on" field on one of the samples to a
+ // reserved value.
+ moof.tracks[1].runs[0].sample_flags[0] = ToSampleFlags("RS");
+ ASSERT_FALSE(iter_->Init(moof));
+}
+
+// Verify that parsing fails if a reserved value is in the default sample flags.
+TEST_F(TrackRunIteratorTest, SampleInfoTest_ReservedInDefaultSampleFlags) {
+ iter_.reset(new TrackRunIterator(&moov_, log_cb_));
+ MovieFragment moof = CreateFragment();
+ // Set the default flag to contain a reserved "depends on" value.
+ moof.tracks[0].header.default_sample_flags = ToSampleFlags("RN");
+ ASSERT_FALSE(iter_->Init(moof));
+}
+
TEST_F(TrackRunIteratorTest, ReorderingTest) {
// Test frame reordering and edit list support. The frames have the following
// decode timestamps:
« no previous file with comments | « media/formats/mp4/track_run_iterator.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698