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

m_kiewitz at users.sourceforge.net m_kiewitz at users.sourceforge.net
Fri Jul 16 21:33:29 CEST 2010


Revision: 50939
          http://scummvm.svn.sourceforge.net/scummvm/?rev=50939&view=rev
Author:   m_kiewitz
Date:     2010-07-16 19:33:28 +0000 (Fri, 16 Jul 2010)

Log Message:
-----------
SCI: adding fixme and error() to fix crash when trying to run unmodified gk2

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

Modified: scummvm/trunk/engines/sci/resource.cpp
===================================================================
--- scummvm/trunk/engines/sci/resource.cpp	2010-07-16 14:16:47 UTC (rev 50938)
+++ scummvm/trunk/engines/sci/resource.cpp	2010-07-16 19:33:28 UTC (rev 50939)
@@ -1396,7 +1396,13 @@
 				// for SCI2.1 and SCI3 maps that are not resmap.000. The resmap.* files' numbers
 				// need to be used in concurrence with the volume specified in the map to get
 				// the actual resource file.
-				addResource(resId, findVolume(map, volume_nr + map->_volumeNumber), off);
+				int mapVolumeNr = volume_nr + map->_volumeNumber;
+				ResourceSource *source = findVolume(map, mapVolumeNr);
+				// FIXME: this code has serious issues with multiple RESMAP.* files (like in unmodified gk2)
+				//         adding a resource with source == NULL would crash later on
+				if (!source)
+					error("Unable to find volume for map %s volumeNr %d", map->getLocationName().c_str(), mapVolumeNr);
+				addResource(resId, source, off);
 			}
 		}
 	}


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