aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--engines/toon/anim.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/engines/toon/anim.cpp b/engines/toon/anim.cpp
index 1c85a8d798..a6744568f7 100644
--- a/engines/toon/anim.cpp
+++ b/engines/toon/anim.cpp
@@ -78,8 +78,10 @@ bool Animation::loadAnimation(const Common::String &file) {
delete[] _frames;
_frames = new AnimationFrame[_numFrames];
for (int32 e = 0; e < _numFrames; e++) {
- if (READ_LE_UINT32(data) != 0x12345678)
+ if (READ_LE_UINT32(data) != 0x12345678) {
+ delete[] finalBuffer;
return false;
+ }
int32 oldRef = READ_LE_UINT32(data + 4);
uint32 compressedSize = READ_LE_UINT32(data + 8);