Bug 1533625 - Replace assert with early return for mp4 missing IV data. r=jya

This assert could be triggered with malformed files, so replace it with an early
return.

Differential Revision: https://phabricator.services.mozilla.com/D30027

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Bryce Van Dyk 2019-05-16 06:40:17 +00:00
parent 1fe446e00c
commit 46e5b04e71

View File

@ -193,11 +193,16 @@ already_AddRefed<MediaRawData> SampleIterator::GetNext() {
moofParser->mSinf.mDefaultConstantIV); moofParser->mSinf.mDefaultConstantIV);
} }
MOZ_ASSERT((writer->mCrypto.mIVSize == 0 && if ((writer->mCrypto.mIVSize == 0 &&
!writer->mCrypto.mConstantIV.IsEmpty()) || writer->mCrypto.mConstantIV.IsEmpty()) ||
!s->mCencRange.IsEmpty(), (writer->mCrypto.mIVSize != 0 && s->mCencRange.IsEmpty())) {
"Crypto information should contain either a constant IV, or " // If mIVSize == 0, this indicates that a constant IV is in use, thus we
"have auxiliary information that will contain an IV"); // should have a non empty constant IV. Alternatively if IV size is non
// zero, we should have an IV for this sample, which we need to look up
// in mCencRange (which must then be non empty). If neither of these are
// true we have bad crypto data, so bail.
return nullptr;
}
// Parse auxiliary information if present // Parse auxiliary information if present
if (!s->mCencRange.IsEmpty()) { if (!s->mCencRange.IsEmpty()) {
// The size comes from an 8 bit field // The size comes from an 8 bit field