Bug 1798778 - Remove an over-zealous assertion when sniffing for an ADTS stream, when the available data is shorter than the next frame header offset. r=alwu

I haven't found a program that plays this file. It crashes some program I tried.

Differential Revision: https://phabricator.services.mozilla.com/D161574
This commit is contained in:
Paul Adenot 2022-11-09 10:01:03 +00:00
Родитель c6bcbe66e0
Коммит 75defd0695
1 изменённых файлов: 0 добавлений и 1 удалений

Просмотреть файл

@ -761,7 +761,6 @@ bool ADTSDemuxer::ADTSSniffer(const uint8_t* aData, const uint32_t aLength) {
// header.
uint64_t nextFrameHeaderOffset =
currentFrame.Offset() + currentFrame.Length();
MOZ_ASSERT(aLength >= nextFrameHeaderOffset);
return aLength > nextFrameHeaderOffset &&
aLength - nextFrameHeaderOffset >= 2 &&
adts::FrameHeader::MatchesSync(aData + nextFrameHeaderOffset);