Fix possible uninitialized var use
authorCampbell Barton <ideasman42@gmail.com>
Wed, 13 Aug 2014 00:38:08 +0000 (10:38 +1000)
committerCampbell Barton <ideasman42@gmail.com>
Wed, 13 Aug 2014 00:38:08 +0000 (10:38 +1000)
source/blender/freestyle/intern/stroke/Stroke.h
source/blender/gpu/intern/gpu_buffers.c

index f919cd36f5c473a36b648139c9a46961927e327c..86c667a38b67a1c1820baa435c0c06780297c8ff 100644 (file)
@@ -664,7 +664,7 @@ public:
        /*! Returns true if this Stroke has textures assigned, false otherwise. */
        inline bool hasTex() const
        {
-               return (_mtex && _mtex[0] != NULL) || _nodeTree;
+               return (_mtex[0] != NULL) || _nodeTree;
        }
 
        /*! Returns true if this Stroke uses a texture with tips, false otherwise. */
index 91eb2a43132c3abda914b8c1c50974a9cd57b0b4..698e72a6b359956ec81b83cb43c2d590b4cd5b71 100644 (file)
@@ -2682,6 +2682,9 @@ bool GPU_pbvh_buffers_diffuse_changed(GPU_PBVH_Buffers *buffers, GSet *bm_faces,
                        f = BLI_gsetIterator_getKey(&gs_iter);
                        GPU_material_diffuse_get(f->mat_nr + 1, diffuse_color);
                }
+               else {
+                       return false;
+               }
        }
        else {
                const DMFlagMat *flags = &buffers->grid_flag_mats[buffers->grid_indices[0]];
@@ -2689,9 +2692,7 @@ bool GPU_pbvh_buffers_diffuse_changed(GPU_PBVH_Buffers *buffers, GSet *bm_faces,
                GPU_material_diffuse_get(flags->mat_nr + 1, diffuse_color);
        }
 
-       return diffuse_color[0] != buffers->diffuse_color[0] ||
-              diffuse_color[1] != buffers->diffuse_color[1] ||
-              diffuse_color[2] != buffers->diffuse_color[2];
+       return !equals_v3v3(diffuse_color, buffers->diffuse_color);
 }
 
 /* release a GPU_PBVH_Buffers id;