[Bf-blender-cvs] [572489e] master: Fix wrong sizeof() in new ghash hashing helpers code.

Bastien Montagne noreply at git.blender.org
Sun Mar 22 21:17:57 CET 2015


Commit: 572489ec8936be0dfa1137f497d295e21f9ce693
Author: Bastien Montagne
Date:   Sun Mar 22 21:13:43 2015 +0100
Branches: master
https://developer.blender.org/rB572489ec8936be0dfa1137f497d295e21f9ce693

Fix wrong sizeof() in new ghash hashing helpers code.

Spotted by Coverity.

===================================================================

M	source/blender/blenlib/intern/BLI_ghash.c

===================================================================

diff --git a/source/blender/blenlib/intern/BLI_ghash.c b/source/blender/blenlib/intern/BLI_ghash.c
index 49d3cec..cd86bb8 100644
--- a/source/blender/blenlib/intern/BLI_ghash.c
+++ b/source/blender/blenlib/intern/BLI_ghash.c
@@ -1004,7 +1004,7 @@ unsigned int BLI_ghashutil_uinthash_v4(const unsigned int key[4])
 }
 unsigned int BLI_ghashutil_uinthash_v4_murmur(const unsigned int key[4])
 {
-	return BLI_hash_mm2((const unsigned char *)key, sizeof(key), 0);
+	return BLI_hash_mm2((const unsigned char *)key, sizeof(int) * 4  /* sizeof(key) */, 0);
 }
 
 bool BLI_ghashutil_uinthash_v4_cmp(const void *a, const void *b)




More information about the Bf-blender-cvs mailing list