Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDaniel Stokes <kupomail@gmail.com>2013-07-20 02:04:06 +0400
committerDaniel Stokes <kupomail@gmail.com>2013-07-20 02:04:06 +0400
commit869d654cccba8b9b0bc295e7ce89e8e322912023 (patch)
treea7a76badcc5c2d4a5e712e89e0153b77edff3368 /source/blender/blenlib
parent68c0028ebcee80d214a9b05018840601d61e64b0 (diff)
BGE fix [#36223] Strange page fault of "Game" actuator
Adding a NULL check to BLI_ghash_lookup
Diffstat (limited to 'source/blender/blenlib')
-rw-r--r--source/blender/blenlib/intern/BLI_ghash.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/source/blender/blenlib/intern/BLI_ghash.c b/source/blender/blenlib/intern/BLI_ghash.c
index d30d3f3d256..5b9045b1ba2 100644
--- a/source/blender/blenlib/intern/BLI_ghash.c
+++ b/source/blender/blenlib/intern/BLI_ghash.c
@@ -116,9 +116,14 @@ void BLI_ghash_insert(GHash *gh, void *key, void *val)
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;