diff options
Diffstat (limited to 'engines/gob/cmpfile.cpp')
-rw-r--r-- | engines/gob/cmpfile.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/engines/gob/cmpfile.cpp b/engines/gob/cmpfile.cpp index d304958f76..0c650a917e 100644 --- a/engines/gob/cmpfile.cpp +++ b/engines/gob/cmpfile.cpp @@ -135,8 +135,11 @@ void CMPFile::loadCMP(Common::SeekableReadStream &cmp) { uint32 size = cmp.size(); byte *data = new byte[size]; - if (cmp.read(data, size) != size) + if (cmp.read(data, size) != size) { + delete[] data; + return; + } _vm->_video->drawPackedSprite(data, _surface->getWidth(), _surface->getHeight(), 0, 0, 0, *_surface); |