[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [58419] trunk/blender/source/blender/ blenlib/intern/BLI_ghash.c: BGE fix [#36223] Strange page fault of "Game" actuator

Daniel Stokes kupomail at gmail.com
Sat Jul 20 00:04:06 CEST 2013


Revision: 58419
          http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=58419
Author:   kupoman
Date:     2013-07-19 22:04:06 +0000 (Fri, 19 Jul 2013)
Log Message:
-----------
BGE fix [#36223] Strange page fault of "Game" actuator

Adding a NULL check to BLI_ghash_lookup

Modified Paths:
--------------
    trunk/blender/source/blender/blenlib/intern/BLI_ghash.c

Modified: trunk/blender/source/blender/blenlib/intern/BLI_ghash.c
===================================================================
--- trunk/blender/source/blender/blenlib/intern/BLI_ghash.c	2013-07-19 20:55:51 UTC (rev 58418)
+++ trunk/blender/source/blender/blenlib/intern/BLI_ghash.c	2013-07-19 22:04:06 UTC (rev 58419)
@@ -116,9 +116,14 @@
 
 void *BLI_ghash_lookup(GHash *gh, const void *key)
 {
-	const unsigned int hash = gh->hashfp(key) % gh->nbuckets;
+
+	unsigned int hash;
 	Entry *e;
 
+	if (!gh) return NULL;
+
+	hash = gh->hashfp(key) % gh->nbuckets;
+
 	for (e = gh->buckets[hash]; e; e = e->next) {
 		if (gh->cmpfp(key, e->key) == 0) {
 			return e->val;




More information about the Bf-blender-cvs mailing list