[Bf-blender-cvs] [810d7d4694] master: Cycles: Fix possibly uninitialized variable

Sergey Sharybin noreply at git.blender.org
Fri Mar 3 10:10:29 CET 2017


Commit: 810d7d469411283531cfca13f332ae59e51693a7
Author: Sergey Sharybin
Date:   Fri Mar 3 10:09:42 2017 +0100
Branches: master
https://developer.blender.org/rB810d7d469411283531cfca13f332ae59e51693a7

Cycles: Fix possibly uninitialized variable

Hopefully this was a reason of randomly disappearing textures in our renders.

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

M	intern/cycles/render/image.cpp

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

diff --git a/intern/cycles/render/image.cpp b/intern/cycles/render/image.cpp
index fd8a126220..8985431b68 100644
--- a/intern/cycles/render/image.cpp
+++ b/intern/cycles/render/image.cpp
@@ -285,9 +285,8 @@ int ImageManager::add_image(const string& filename,
 
 	thread_scoped_lock device_lock(device_mutex);
 
-	/* Do we have a float? */
-	if(type == IMAGE_DATA_TYPE_FLOAT || type == IMAGE_DATA_TYPE_FLOAT4)
-		is_float = true;
+	/* Check whether it's a float texture. */
+	is_float = (type == IMAGE_DATA_TYPE_FLOAT || type == IMAGE_DATA_TYPE_FLOAT4);
 
 	/* No single channel and half textures on CUDA (Fermi) and no half on OpenCL, use available slots */
 	if((type == IMAGE_DATA_TYPE_FLOAT ||




More information about the Bf-blender-cvs mailing list