diff options
author | Sven Hesse | 2012-06-28 01:31:59 +0200 |
---|---|---|
committer | Sven Hesse | 2012-07-30 01:24:18 +0200 |
commit | 1cb6cc0218382bbf5fe487fd0e84d233e56592bb (patch) | |
tree | 15c6126317a29e32ee5b23eb1d0975bc305138bc /engines/gob | |
parent | 099a76ea20fa0f8290815f988d2202b6702d589b (diff) | |
download | scummvm-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.cpp | 4 |
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; |