aboutsummaryrefslogtreecommitdiff
path: root/engines/gob
diff options
context:
space:
mode:
authorSven Hesse2012-06-28 01:31:59 +0200
committerSven Hesse2012-07-30 01:24:18 +0200
commit1cb6cc0218382bbf5fe487fd0e84d233e56592bb (patch)
tree15c6126317a29e32ee5b23eb1d0975bc305138bc /engines/gob
parent099a76ea20fa0f8290815f988d2202b6702d589b (diff)
downloadscummvm-rg350-1cb6cc0218382bbf5fe487fd0e84d233e56592bb.tar.gz
scummvm-rg350-1cb6cc0218382bbf5fe487fd0e84d233e56592bb.tar.bz2
scummvm-rg350-1cb6cc0218382bbf5fe487fd0e84d233e56592bb.zip
GOB: Don't crash when drawPackedSprite() can't open the sprite
Diffstat (limited to 'engines/gob')
-rw-r--r--engines/gob/video.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/engines/gob/video.cpp b/engines/gob/video.cpp
index 3b1c6423bb..f1f014cce0 100644
--- a/engines/gob/video.cpp
+++ b/engines/gob/video.cpp
@@ -332,6 +332,10 @@ void Video::drawPackedSprite(byte *sprBuf, int16 width, int16 height,
void Video::drawPackedSprite(const char *path, Surface &dest, int width) {
int32 size;
byte *data = _vm->_dataIO->getFile(path, size);
+ if (!data) {
+ warning("Video::drawPackedSprite(): Failed to open sprite \"%s\"", path);
+ return;
+ }
drawPackedSprite(data, width, dest.getHeight(), 0, 0, 0, dest);
delete[] data;