mirror of
https://github.com/mozilla/gecko-dev.git
synced 2024-10-09 11:25:00 +00:00
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:
parent
1fe446e00c
commit
46e5b04e71
@ -193,11 +193,16 @@ already_AddRefed<MediaRawData> SampleIterator::GetNext() {
|
||||
moofParser->mSinf.mDefaultConstantIV);
|
||||
}
|
||||
|
||||
MOZ_ASSERT((writer->mCrypto.mIVSize == 0 &&
|
||||
!writer->mCrypto.mConstantIV.IsEmpty()) ||
|
||||
!s->mCencRange.IsEmpty(),
|
||||
"Crypto information should contain either a constant IV, or "
|
||||
"have auxiliary information that will contain an IV");
|
||||
if ((writer->mCrypto.mIVSize == 0 &&
|
||||
writer->mCrypto.mConstantIV.IsEmpty()) ||
|
||||
(writer->mCrypto.mIVSize != 0 && s->mCencRange.IsEmpty())) {
|
||||
// If mIVSize == 0, this indicates that a constant IV is in use, thus we
|
||||
// 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
|
||||
if (!s->mCencRange.IsEmpty()) {
|
||||
// The size comes from an 8 bit field
|
||||
|
Loading…
Reference in New Issue
Block a user