GPUBuffers: Fix uninitialized memory use causing undefined conditional jump
authorClément Foucault <foucault.clem@gmail.com>
Wed, 12 Dec 2018 15:53:41 +0000 (16:53 +0100)
committerClément Foucault <foucault.clem@gmail.com>
Fri, 14 Dec 2018 15:17:29 +0000 (16:17 +0100)
source/blender/gpu/intern/gpu_buffers.c

index 38edcbe7f7111cf3f84b99dba89d1ae4b1730aeb..deb1021397611bc35d2505bda2535f56bc31c0f4 100644 (file)
@@ -341,7 +341,7 @@ static void gpu_pbvh_grid_fill_fast_buffer(GPU_PBVH_Buffers *buffers, int totgri
                GPU_indexbuf_init_ex(&elb, GPU_PRIM_TRI_STRIP, 5 * totgrid, INT_MAX, true);
                uint vbo_index_offset = 0;
                for (int i = 0; i < totgrid; i++) {
-                       uint grid_indices[4];
+                       uint grid_indices[4] = {0, 0, 0, 0};
                        for (int j = 0; j < gridsize - 1; j++) {
                                for (int k = 0; k < gridsize - 1; k++) {
                                        const bool is_row_start = (k == 0);