Cycles: Fix possibly uninitialized variable
authorSergey Sharybin <sergey.vfx@gmail.com>
Fri, 3 Mar 2017 09:09:42 +0000 (10:09 +0100)
committerSergey Sharybin <sergey.vfx@gmail.com>
Fri, 3 Mar 2017 09:10:26 +0000 (10:10 +0100)
Hopefully this was a reason of randomly disappearing textures in our renders.

intern/cycles/render/image.cpp

index fd8a1262208f823109f2ec0d50773da58fa77f21..8985431b68adbc9bf83bcb2f9fcd9c505bf6551e 100644 (file)
@@ -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 ||