aboutsummaryrefslogtreecommitdiff
path: root/engines
diff options
context:
space:
mode:
Diffstat (limited to 'engines')
-rw-r--r--engines/gob/cmpfile.cpp5
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);