diff options
author | Chris Apers | 2007-01-28 18:40:30 +0000 |
---|---|---|
committer | Chris Apers | 2007-01-28 18:40:30 +0000 |
commit | 06c3d2cb2a36ee6e8ba2a5d70dfa16c011ea4e41 (patch) | |
tree | b48dc3f232f2083841da6d04a66e0a1155b594ab | |
parent | 2c1a3e1cd216337fa501657e75d4c2efbad70421 (diff) | |
download | scummvm-rg350-06c3d2cb2a36ee6e8ba2a5d70dfa16c011ea4e41.tar.gz scummvm-rg350-06c3d2cb2a36ee6e8ba2a5d70dfa16c011ea4e41.tar.bz2 scummvm-rg350-06c3d2cb2a36ee6e8ba2a5d70dfa16c011ea4e41.zip |
Fix crash on PalmOS due to out of memory
svn-id: r25248
-rw-r--r-- | engines/agos/res_ami.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/engines/agos/res_ami.cpp b/engines/agos/res_ami.cpp index 76ff32ecf6..28e1357fef 100644 --- a/engines/agos/res_ami.cpp +++ b/engines/agos/res_ami.cpp @@ -89,6 +89,10 @@ static void convertcompressedclip(uint16 height, uint16 width) { char n; uncbuffer = (byte *)malloc(height * width * 4); uncbfrout = (byte *)malloc(height * width * 4); + + byte *free_uncbuffer = uncbuffer; + byte *free_uncbfrout = uncbfrout; + length = width / 16; length *= height; plane0 = READ_BE_UINT16(clipptr) + READ_BE_UINT16(clipptr + 2) + clipptr; clipptr += 4; plane0 += 4; @@ -217,8 +221,8 @@ static void convertcompressedclip(uint16 height, uint16 width) { } if (cliplength > (height * width / 2)) warning("Negative compression. Clip %d. %d bytes bigger.",clipnumber,(cliplength-(height*width/2))); - //free(uncbuffer); - //free(uncbfrout); + free(free_uncbuffer); + free(free_uncbfrout); } static void convertclip(uint32 offset, uint16 height, uint16 width) { |