GOB: Don't crash when drawPackedSprite() can't open the sprite

This commit is contained in:
Sven Hesse 2012-06-28 01:31:59 +02:00
parent 099a76ea20
commit 1cb6cc0218

View File

@ -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;