[Bf-blender-cvs] [a075f45526e] blender-v2.82-release: Fix more undefined behavior in tangent space computation

Brecht Van Lommel noreply at git.blender.org
Fri Jan 31 13:02:24 CET 2020


Commit: a075f45526eccb218314368859ac4ce9138bd0be
Author: Brecht Van Lommel
Date:   Wed Jan 29 15:06:25 2020 +0100
Branches: blender-v2.82-release
https://developer.blender.org/rBa075f45526eccb218314368859ac4ce9138bd0be

Fix more undefined behavior in tangent space computation

Ref D6677

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

M	intern/mikktspace/mikktspace.c

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

diff --git a/intern/mikktspace/mikktspace.c b/intern/mikktspace/mikktspace.c
index 285529298eb..47bed53ed28 100644
--- a/intern/mikktspace/mikktspace.c
+++ b/intern/mikktspace/mikktspace.c
@@ -1392,7 +1392,7 @@ static void QuickSort(int *pSortBuffer, int iLeft, int iRight, unsigned int uSee
 
   // Random
   unsigned int t = uSeed & 31;
-  t = (uSeed << t) | (uSeed >> (32 - t));
+  t = rotl(uSeed, t);
   uSeed = uSeed + t + 3;
   // Random end



More information about the Bf-blender-cvs mailing list