Bug 1245789 - Handle unencrypted samples in encrypted media. r=gerald

Some encrypted MP4 files lack subsample info for some samples, so we need this check
to prevent us crashing on such files.

MozReview-Commit-ID: AXqOCAlb7IY
This commit is contained in:
Chris Pearce 2016-04-12 16:12:20 +12:00
parent 78b35c32d6
commit 2a0d4dd3a3

View File

@ -169,15 +169,20 @@ GMPDecryptorParent::Decrypt(uint32_t aId,
}
// Caller should ensure parameters passed in are valid.
MOZ_ASSERT(!aBuffer.IsEmpty() && aCrypto.mValid);
MOZ_ASSERT(!aBuffer.IsEmpty());
GMPDecryptionData data(aCrypto.mKeyId,
aCrypto.mIV,
aCrypto.mPlainSizes,
aCrypto.mEncryptedSizes,
aCrypto.mSessionIds);
if (aCrypto.mValid) {
GMPDecryptionData data(aCrypto.mKeyId,
aCrypto.mIV,
aCrypto.mPlainSizes,
aCrypto.mEncryptedSizes,
aCrypto.mSessionIds);
Unused << SendDecrypt(aId, aBuffer, data);
Unused << SendDecrypt(aId, aBuffer, data);
} else {
GMPDecryptionData data;
Unused << SendDecrypt(aId, aBuffer, data);
}
}
bool