Fail MPEG header check when frame length is zero (#1174)

This commit is contained in:
Urs Fleisch 2023-11-16 18:48:00 +01:00
parent c86a2fce70
commit b7dc1ab8ac

View File

@ -336,6 +336,11 @@ void MPEG::Header::parse(File *file, offset_t offset, bool checkLength)
// consistent. Otherwise, we assume that either or both of the frames are
// broken.
// A frame length of 0 is probably invalid and would pass the test below
// because nextData would be the same as data.
if(d->frameLength == 0)
return;
file->seek(offset + d->frameLength);
const ByteVector nextData = file->readBlock(4);