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

Unified Diff: media/cdm/cenc_utils.cc

Issue 1189073004: Properly verify that input data is just 'pssh' boxes (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Android compile issues Created 5 years, 6 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 | « no previous file | media/cdm/cenc_utils_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: media/cdm/cenc_utils.cc
diff --git a/media/cdm/cenc_utils.cc b/media/cdm/cenc_utils.cc
index ec7544ef8a168b7e7d5ab11b5c6abaf89bbbd373..357bb6a688fb5e445457727ff8c86ce50b12bd7a 100644
--- a/media/cdm/cenc_utils.cc
+++ b/media/cdm/cenc_utils.cc
@@ -30,17 +30,18 @@ static bool ReadAllPsshBoxes(
std::vector<mp4::FullProtectionSystemSpecificHeader>* pssh_boxes) {
DCHECK(!input.empty());
- // Verify that |input| contains only 'pssh' boxes. ReadAllChildren() is
- // templated, so it checks that each box in |input| matches the box type of
- // the parameter (in this case mp4::ProtectionSystemSpecificHeader is a
- // 'pssh' box). mp4::ProtectionSystemSpecificHeader doesn't validate the
- // 'pssh' contents, so this simply verifies that |input| only contains
- // 'pssh' boxes and nothing else.
+ // Verify that |input| contains only 'pssh' boxes.
+ // ReadAllChildrenAndCheckFourCC() is templated, so it checks that each
+ // box in |input| matches the box type of the parameter (in this case
+ // mp4::ProtectionSystemSpecificHeader is a 'pssh' box).
+ // mp4::ProtectionSystemSpecificHeader doesn't validate the 'pssh' contents,
+ // so this simply verifies that |input| only contains 'pssh' boxes and
+ // nothing else.
scoped_ptr<mp4::BoxReader> input_reader(
mp4::BoxReader::ReadConcatentatedBoxes(
vector_as_array(&input), input.size()));
std::vector<mp4::ProtectionSystemSpecificHeader> raw_pssh_boxes;
- if (!input_reader->ReadAllChildren(&raw_pssh_boxes))
+ if (!input_reader->ReadAllChildrenAndCheckFourCC(&raw_pssh_boxes))
return false;
// Now that we have |input| parsed into |raw_pssh_boxes|, reparse each one
@@ -56,7 +57,7 @@ static bool ReadAllPsshBoxes(
// ReadAllChildren() appends any successfully parsed box onto it's
// parameter, so |pssh_boxes| will contain the collection of successfully
// parsed 'pssh' boxes. If an error occurs, try the next box.
- if (!raw_pssh_reader->ReadAllChildren(pssh_boxes))
+ if (!raw_pssh_reader->ReadAllChildrenAndCheckFourCC(pssh_boxes))
continue;
}
« no previous file with comments | « no previous file | media/cdm/cenc_utils_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698