Chromium Code Reviews| Index: media/mp4/box_definitions.cc |
| diff --git a/media/mp4/box_definitions.cc b/media/mp4/box_definitions.cc |
| index 9b64f48b1594567f4642af20d153fe8fd1d4e13c..c008969d63bc039763b0834c4d9b461d4638ba54 100644 |
| --- a/media/mp4/box_definitions.cc |
| +++ b/media/mp4/box_definitions.cc |
| @@ -26,11 +26,18 @@ ProtectionSystemSpecificHeader::~ProtectionSystemSpecificHeader() {} |
| FourCC ProtectionSystemSpecificHeader::BoxType() const { return FOURCC_PSSH; } |
| bool ProtectionSystemSpecificHeader::Parse(BoxReader* reader) { |
| + // Validate the box's contents and hang on to the system ID. |
| uint32 size; |
| - return reader->ReadFullBoxHeader() && |
| + RCHECK(reader->ReadFullBoxHeader() && |
| reader->ReadVec(&system_id, 16) && |
| reader->Read4(&size) && |
| - reader->ReadVec(&data, size); |
| + reader->HasBytes(size)); |
| + |
| + // Copy the entire box, including the header, for passing to EME as initData. |
| + raw_box.clear(); |
|
ddorwin
2012/09/21 04:04:28
Should it ever not be empty?
strobe_
2012/09/21 18:29:46
Changed to DCHECK(empty())
|
| + raw_box.insert(raw_box.end(), |
|
ddorwin
2012/09/21 04:04:28
Odd to use end() when you just cleared it. Can you
strobe_
2012/09/21 18:29:46
Done.
|
| + reader->data(), reader->data() + reader->size()); |
| + return true; |
| } |
| SampleAuxiliaryInformationOffset::SampleAuxiliaryInformationOffset() {} |