mesa/bindless: fix missing image _Layer initialization
authorIlia Mirkin <imirkin@alum.mit.edu>
Sat, 30 Dec 2017 05:28:51 +0000 (00:28 -0500)
committerIlia Mirkin <imirkin@alum.mit.edu>
Thu, 4 Jan 2018 07:22:25 +0000 (02:22 -0500)
Some later code relies on _Layer to set first/last_layer. Make sure it's
always initialized.

Detected by valgrind's conditional jump/move with uninit value logic.

Signed-off-by: Ilia Mirkin <imirkin@alum.mit.edu>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
src/mesa/main/texturebindless.c

index f062ea904a14e15ea776ecf994b8e79184ffde5a..9aaa0367c2daf1007a0671e058193583ee763ff3 100644 (file)
@@ -327,6 +327,7 @@ get_image_handle(struct gl_context *ctx, struct gl_texture_object *texObj,
    } else {
       imgObj.Layered = GL_FALSE;
       imgObj.Layer = 0;
+      imgObj._Layer = 0;
    }
 
    /* Request a new image handle from the driver. */