[Scummvm-cvs-logs] SF.net SVN: scummvm:[39185] scummvm/trunk/engines/sci/scicore/resource.cpp

gregfrieger at users.sourceforge.net gregfrieger at users.sourceforge.net
Sat Mar 7 15:40:58 CET 2009


Revision: 39185
          http://scummvm.svn.sourceforge.net/scummvm/?rev=39185&view=rev
Author:   gregfrieger
Date:     2009-03-07 14:40:58 +0000 (Sat, 07 Mar 2009)

Log Message:
-----------
Fixed crash when reading some SCI1 resource map

Modified Paths:
--------------
    scummvm/trunk/engines/sci/scicore/resource.cpp

Modified: scummvm/trunk/engines/sci/scicore/resource.cpp
===================================================================
--- scummvm/trunk/engines/sci/scicore/resource.cpp	2009-03-07 13:40:00 UTC (rev 39184)
+++ scummvm/trunk/engines/sci/scicore/resource.cpp	2009-03-07 14:40:58 UTC (rev 39185)
@@ -916,8 +916,8 @@
 	if (!file.open(map->location_name))
 		return SCI_ERROR_RESMAP_NOT_FOUND;
 
-	resource_index_t resMap[kResourceTypeInvalid];
-	memset(resMap, 0, sizeof(resource_index_t) * kResourceTypeInvalid);
+	resource_index_t resMap[32];
+	memset(resMap, 0, sizeof(resource_index_t) * 32);
 	byte type = 0, prevtype = 0;
 	byte nEntrySize = _mapVersion == SCI_VERSION_1_1 ? SCI11_RESMAP_ENTRIES_SIZE : SCI1_RESMAP_ENTRIES_SIZE;
 	uint32 resId;
@@ -934,7 +934,7 @@
 
 	// reading each type's offsets
 	uint32 off = 0;
-	for (type = 0; type < kResourceTypeInvalid; type++) {
+	for (type = 0; type < 32; type++) {
 		if (resMap[type].wOffset == 0) // this resource does not exist in map
 			continue;
 		file.seek(resMap[type].wOffset);


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