[Scummvm-cvs-logs] SF.net SVN: scummvm:[52813] scummvm/trunk/engines/gob/driver_vga.cpp

eriktorbjorn at users.sourceforge.net eriktorbjorn at users.sourceforge.net
Mon Sep 20 02:02:13 CEST 2010


Revision: 52813
          http://scummvm.svn.sourceforge.net/scummvm/?rev=52813&view=rev
Author:   eriktorbjorn
Date:     2010-09-20 00:02:12 +0000 (Mon, 20 Sep 2010)

Log Message:
-----------
GOB: Don't crash if getCharData() returns NULL

This happened to me when playing the floppy version of Gobliins 2. I
don't know if it's a fix or a workaround, but the function can clearly
return NULL so let's guard against it.

Modified Paths:
--------------
    scummvm/trunk/engines/gob/driver_vga.cpp

Modified: scummvm/trunk/engines/gob/driver_vga.cpp
===================================================================
--- scummvm/trunk/engines/gob/driver_vga.cpp	2010-09-19 21:08:12 UTC (rev 52812)
+++ scummvm/trunk/engines/gob/driver_vga.cpp	2010-09-20 00:02:12 UTC (rev 52813)
@@ -75,6 +75,16 @@
 	uint16 data;
 
 	const byte *src = font.getCharData(item);
+
+	// This happens for me at the mountain (World 6) in Gobliins 2, if I
+	// move the cursor over the "!" part of the ledge while trying to use
+	// an object.
+
+	if (!src) {
+		warning("drawLetter: getCharData() returned NULL");
+		return;
+	}
+
 	byte *dst = dest.getVidMem() + x + dest.getWidth() * y;
 
 	int nWidth = font.getCharWidth();


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