Commit 66fcdd5d authored by strobe@google.com's avatar strobe@google.com

Ignore unrecognized protection schemes in ISO BMFF files.

BUG=
TEST=Manual, in browser


Review URL: https://chromiumcodereview.appspot.com/10827079

git-svn-id: svn://svn.chromium.org/chrome/trunk/src@148874 0039d316-1c4b-4281-b951-d872f2087c98
parent 9313bd4f
...@@ -91,7 +91,6 @@ bool SchemeType::Parse(BoxReader* reader) { ...@@ -91,7 +91,6 @@ bool SchemeType::Parse(BoxReader* reader) {
RCHECK(reader->ReadFullBoxHeader() && RCHECK(reader->ReadFullBoxHeader() &&
reader->ReadFourCC(&type) && reader->ReadFourCC(&type) &&
reader->Read4(&version)); reader->Read4(&version));
RCHECK(type == FOURCC_CENC);
return true; return true;
} }
...@@ -132,8 +131,13 @@ FourCC ProtectionSchemeInfo::BoxType() const { return FOURCC_SINF; } ...@@ -132,8 +131,13 @@ FourCC ProtectionSchemeInfo::BoxType() const { return FOURCC_SINF; }
bool ProtectionSchemeInfo::Parse(BoxReader* reader) { bool ProtectionSchemeInfo::Parse(BoxReader* reader) {
RCHECK(reader->ScanChildren() && RCHECK(reader->ScanChildren() &&
reader->ReadChild(&format) && reader->ReadChild(&format) &&
reader->ReadChild(&type) && reader->ReadChild(&type));
reader->ReadChild(&info)); if (type.type == FOURCC_CENC)
RCHECK(reader->ReadChild(&info));
// Other protection schemes are silently ignored. Since the protection scheme
// type can't be determined until this box is opened, we return 'true' for
// non-CENC protection scheme types. It is the parent box's responsibility to
// ensure that this scheme type is a supported one.
return true; return true;
} }
...@@ -381,8 +385,15 @@ bool VideoSampleEntry::Parse(BoxReader* reader) { ...@@ -381,8 +385,15 @@ bool VideoSampleEntry::Parse(BoxReader* reader) {
RCHECK(reader->ScanChildren() && RCHECK(reader->ScanChildren() &&
reader->MaybeReadChild(&pixel_aspect)); reader->MaybeReadChild(&pixel_aspect));
if (format == FOURCC_ENCV) if (format == FOURCC_ENCV) {
RCHECK(reader->ReadChild(&sinf)); // Continue scanning until a recognized protection scheme is found, or until
// we run out of protection schemes.
while (sinf.type.type != FOURCC_CENC) {
if (!reader->ReadChild(&sinf))
return false;
}
}
if (format == FOURCC_AVC1 || if (format == FOURCC_AVC1 ||
(format == FOURCC_ENCV && sinf.format.format == FOURCC_AVC1)) { (format == FOURCC_ENCV && sinf.format.format == FOURCC_AVC1)) {
RCHECK(reader->ReadChild(&avcc)); RCHECK(reader->ReadChild(&avcc));
...@@ -442,8 +453,15 @@ bool AudioSampleEntry::Parse(BoxReader* reader) { ...@@ -442,8 +453,15 @@ bool AudioSampleEntry::Parse(BoxReader* reader) {
samplerate >>= 16; samplerate >>= 16;
RCHECK(reader->ScanChildren()); RCHECK(reader->ScanChildren());
if (format == FOURCC_ENCA) if (format == FOURCC_ENCA) {
RCHECK(reader->ReadChild(&sinf)); // Continue scanning until a recognized protection scheme is found, or until
// we run out of protection schemes.
while (sinf.type.type != FOURCC_CENC) {
if (!reader->ReadChild(&sinf))
return false;
}
}
RCHECK(reader->ReadChild(&esds)); RCHECK(reader->ReadChild(&esds));
return true; return true;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment