Index: media/formats/mp4/box_definitions.cc |
diff --git a/media/formats/mp4/box_definitions.cc b/media/formats/mp4/box_definitions.cc |
index 1912aaeb640fef0a46d07579f70a51eaad78559b..860f36da8a361e62e4bbaccae1a6ff7dd77c6a71 100644 |
--- a/media/formats/mp4/box_definitions.cc |
+++ b/media/formats/mp4/box_definitions.cc |
@@ -349,6 +349,18 @@ AVCDecoderConfigurationRecord::~AVCDecoderConfigurationRecord() {} |
FourCC AVCDecoderConfigurationRecord::BoxType() const { return FOURCC_AVCC; } |
bool AVCDecoderConfigurationRecord::Parse(BoxReader* reader) { |
+ return ParseInternal(reader); |
+} |
+ |
+bool AVCDecoderConfigurationRecord::Parse(const uint8* data, int data_size) { |
+ DCHECK(data); |
scherkus (not reviewing)
2014/05/05 18:22:17
you DCHECK here but BufferReader CHECK()s
remove?
acolwell GONE FROM CHROMIUM
2014/05/05 18:49:02
Done.
|
+ DCHECK_GE(data_size, 0); |
+ |
+ BufferReader reader(data, data_size); |
+ return ParseInternal(&reader); |
+} |
+ |
+bool AVCDecoderConfigurationRecord::ParseInternal(BufferReader* reader) { |
RCHECK(reader->Read1(&version) && version == 1 && |
reader->Read1(&profile_indication) && |
reader->Read1(&profile_compatibility) && |
@@ -359,6 +371,8 @@ bool AVCDecoderConfigurationRecord::Parse(BoxReader* reader) { |
(length_size_minus_one & 0xfc) == 0xfc); |
length_size = (length_size_minus_one & 0x3) + 1; |
+ RCHECK(length_size != 3); // Only values of 1, 2, and 4 are valid. |
+ |
uint8 num_sps; |
RCHECK(reader->Read1(&num_sps) && (num_sps & 0xe0) == 0xe0); |
num_sps &= 0x1f; |