aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthew Hoops2011-07-19 09:38:40 -0400
committerMatthew Hoops2011-07-19 09:41:31 -0400
commit7484ba037cc75201e6cdae0374e9cd6baa1922a4 (patch)
tree6f360159e160b81c6e16699567dfd7027b919fa8
parent724d7ef1018f2f0195c57da54f1b054787bbcaa7 (diff)
downloadscummvm-rg350-7484ba037cc75201e6cdae0374e9cd6baa1922a4.tar.gz
scummvm-rg350-7484ba037cc75201e6cdae0374e9cd6baa1922a4.tar.bz2
scummvm-rg350-7484ba037cc75201e6cdae0374e9cd6baa1922a4.zip
VIDEO: Better handle failing loading Smacker videos
-rw-r--r--video/smk_decoder.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/video/smk_decoder.cpp b/video/smk_decoder.cpp
index c4c3721a28..adb8fad8d8 100644
--- a/video/smk_decoder.cpp
+++ b/video/smk_decoder.cpp
@@ -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();