[Scummvm-cvs-logs] SF.net SVN: scummvm:[40492] scummvm/trunk/engines/sci/engine/seg_manager. cpp
waltervn at users.sourceforge.net
waltervn at users.sourceforge.net
Tue May 12 16:58:44 CEST 2009
Revision: 40492
http://scummvm.svn.sourceforge.net/scummvm/?rev=40492&view=rev
Author: waltervn
Date: 2009-05-12 14:58:44 +0000 (Tue, 12 May 2009)
Log Message:
-----------
SCI: Fixed a valgrind warning.
Modified Paths:
--------------
scummvm/trunk/engines/sci/engine/seg_manager.cpp
Modified: scummvm/trunk/engines/sci/engine/seg_manager.cpp
===================================================================
--- scummvm/trunk/engines/sci/engine/seg_manager.cpp 2009-05-12 14:55:45 UTC (rev 40491)
+++ scummvm/trunk/engines/sci/engine/seg_manager.cpp 2009-05-12 14:58:44 UTC (rev 40492)
@@ -818,8 +818,8 @@
/* We are forced to use an ugly heuristic here to distinguish function
exports from object/class exports. The former kind points into the
script resource, the latter into the heap resource. */
- int location = READ_LE_UINT16((byte *)(scr->export_table + i));
- if (READ_LE_UINT16(scr->heap_start + location) == SCRIPT_OBJECT_MAGIC_NUMBER) {
+ uint16 location = READ_LE_UINT16((byte *)(scr->export_table + i));
+ if ((location < scr->heap_size - 1) && (READ_LE_UINT16(scr->heap_start + location) == SCRIPT_OBJECT_MAGIC_NUMBER)) {
WRITE_LE_UINT16((byte *)(scr->export_table + i), location + scr->heap_start - scr->buf);
} else {
// Otherwise it's probably a function export,
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