diff options
| author | Willem Jan Palenstijn | 2013-04-25 23:22:55 +0200 |
|---|---|---|
| committer | Willem Jan Palenstijn | 2013-04-25 23:22:55 +0200 |
| commit | 1841d184979e22741905cf1ebe643eaedf822338 (patch) | |
| tree | 983ebcafd4c3ad7fa8828f7973f0987b30f37aa4 /engines/toon | |
| parent | 38fa74d24ab5065acfdbd65ff3432cd33080d1f1 (diff) | |
| download | scummvm-rg350-1841d184979e22741905cf1ebe643eaedf822338.tar.gz scummvm-rg350-1841d184979e22741905cf1ebe643eaedf822338.tar.bz2 scummvm-rg350-1841d184979e22741905cf1ebe643eaedf822338.zip | |
TOON: Fix memory leak
Diffstat (limited to 'engines/toon')
| -rw-r--r-- | engines/toon/anim.cpp | 4 |
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); |
