[Scummvm-cvs-logs] SF.net SVN: scummvm:[52812] scummvm/branches/branch-1-2-0/engines/sword2
sev at users.sourceforge.net
sev at users.sourceforge.net
Sun Sep 19 23:08:12 CEST 2010
Revision: 52812
http://scummvm.svn.sourceforge.net/scummvm/?rev=52812&view=rev
Author: sev
Date: 2010-09-19 21:08:12 +0000 (Sun, 19 Sep 2010)
Log Message:
-----------
SWORD2: Backport plugging memory leaks
Modified Paths:
--------------
scummvm/branches/branch-1-2-0/engines/sword2/screen.cpp
scummvm/branches/branch-1-2-0/engines/sword2/sprite.cpp
Modified: scummvm/branches/branch-1-2-0/engines/sword2/screen.cpp
===================================================================
--- scummvm/branches/branch-1-2-0/engines/sword2/screen.cpp 2010-09-19 21:06:11 UTC (rev 52811)
+++ scummvm/branches/branch-1-2-0/engines/sword2/screen.cpp 2010-09-19 21:08:12 UTC (rev 52812)
@@ -966,11 +966,15 @@
if (Sword2Engine::isPsx()) {
if (!f.open("credits.txt")) {
warning("Can't find credits.txt");
+
+ free(logoData);
return;
}
} else {
if (!f.open("credits.clu")) {
warning("Can't find credits.clu");
+
+ free(logoData);
return;
}
}
Modified: scummvm/branches/branch-1-2-0/engines/sword2/sprite.cpp
===================================================================
--- scummvm/branches/branch-1-2-0/engines/sword2/sprite.cpp 2010-09-19 21:06:11 UTC (rev 52811)
+++ scummvm/branches/branch-1-2-0/engines/sword2/sprite.cpp 2010-09-19 21:08:12 UTC (rev 52812)
@@ -528,8 +528,11 @@
decompData = decompressHIF(s->data, tempBuf);
// Check that we correctly decompressed data
- if (!decompData)
+ if (!decompData) {
+ free(tempBuf);
+
return RDERR_DECOMPRESSION;
+ }
s->w = (decompData / (s->h / 2)) * 2;
byte *tempBuf2 = (byte *)malloc(s->w * s->h * 10);
@@ -571,8 +574,11 @@
uint32 decompData = decompressHIF(s->data, tempBuf);
// Check that we correctly decompressed data
- if (!decompData)
+ if (!decompData) {
+ free(tempBuf);
+
return RDERR_DECOMPRESSION;
+ }
s->w = (decompData / (s->h / 2));
sprite = (byte *)malloc(s->w * s->h);
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