mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-14 05:38:56 +00:00
VIDEO: Respect RIFF filesize field when decoding AVI files
Starship Titanic in particular needs this, since some of the videos have extra junk at the end of the file, such as ycursors.avi, and parsing fails if we don't respect the filesize field
This commit is contained in:
parent
fd954a8e0b
commit
62f2763bf7
@ -296,7 +296,7 @@ bool AVIDecoder::loadStream(Common::SeekableReadStream *stream) {
|
||||
return false;
|
||||
}
|
||||
|
||||
/* uint32 fileSize = */ stream->readUint32LE();
|
||||
uint32 fileSize = stream->readUint32LE();
|
||||
uint32 riffType = stream->readUint32BE();
|
||||
|
||||
if (riffType != ID_AVI) {
|
||||
@ -307,7 +307,7 @@ bool AVIDecoder::loadStream(Common::SeekableReadStream *stream) {
|
||||
_fileStream = stream;
|
||||
|
||||
// Go through all chunks in the file
|
||||
while (parseNextChunk())
|
||||
while (_fileStream->pos() < fileSize && parseNextChunk())
|
||||
;
|
||||
|
||||
if (!_decodedHeader) {
|
||||
|
Loading…
Reference in New Issue
Block a user