VIDEO: Better handle failing loading Smacker videos

This commit is contained in:
Matthew Hoops 2011-07-19 09:38:40 -04:00
parent 724d7ef101
commit 7484ba037c

View File

@ -372,9 +372,11 @@ bool SmackerDecoder::loadStream(Common::SeekableReadStream *stream) {
_fileStream = stream;
// Seek to the first frame
// Read in the Smacker header
_header.signature = _fileStream->readUint32BE();
assert(_header.signature == MKTAG('S','M','K','2') || _header.signature == MKTAG('S','M','K','4'));
if (_header.signature != MKTAG('S', 'M', 'K', '2') && _header.signature == MKTAG('S', 'M', 'K', '4'))
return false;
uint32 width = _fileStream->readUint32LE();
uint32 height = _fileStream->readUint32LE();