[Bf-blender-cvs] [4b0c2152db0] master: Fix use of uninitialized GPU context memory in release builds.

Brecht Van Lommel noreply at git.blender.org
Thu Jan 10 20:12:07 CET 2019


Commit: 4b0c2152db0e232ccc5e32942b5bf36ab87d362a
Author: Brecht Van Lommel
Date:   Thu Jan 10 20:03:05 2019 +0100
Branches: master
https://developer.blender.org/rB4b0c2152db0e232ccc5e32942b5bf36ab87d362a

Fix use of uninitialized GPU context memory in release builds.

Reported by valgrind, not sure it caused any real bugs.

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

M	source/blender/gpu/intern/gpu_context.cpp

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

diff --git a/source/blender/gpu/intern/gpu_context.cpp b/source/blender/gpu/intern/gpu_context.cpp
index ce3eb64fa37..9c41d232fb0 100644
--- a/source/blender/gpu/intern/gpu_context.cpp
+++ b/source/blender/gpu/intern/gpu_context.cpp
@@ -80,12 +80,14 @@ struct GPUContext {
 #if TRUST_NO_ONE
 	pthread_t thread; /* Thread on which this context is active. */
 	bool thread_is_used;
+#endif
 
 	GPUContext() {
+#if TRUST_NO_ONE
 		thread_is_used = false;
+#endif
 		current_fbo = 0;
 	}
-#endif
 };
 
 #if defined(_MSC_VER) && (_MSC_VER == 1800)



More information about the Bf-blender-cvs mailing list