[Scummvm-cvs-logs] SF.net SVN: scummvm: [25248] scummvm/trunk/engines/agos/res_ami.cpp
chrilith at users.sourceforge.net
chrilith at users.sourceforge.net
Sun Jan 28 19:40:31 CET 2007
Revision: 25248
http://scummvm.svn.sourceforge.net/scummvm/?rev=25248&view=rev
Author: chrilith
Date: 2007-01-28 10:40:30 -0800 (Sun, 28 Jan 2007)
Log Message:
-----------
Fix crash on PalmOS due to out of memory
Modified Paths:
--------------
scummvm/trunk/engines/agos/res_ami.cpp
Modified: scummvm/trunk/engines/agos/res_ami.cpp
===================================================================
--- scummvm/trunk/engines/agos/res_ami.cpp 2007-01-28 18:38:26 UTC (rev 25247)
+++ scummvm/trunk/engines/agos/res_ami.cpp 2007-01-28 18:40:30 UTC (rev 25248)
@@ -89,6 +89,10 @@
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 @@
}
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) {
This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.
More information about the Scummvm-git-logs
mailing list