glsl: Initialize outputs[] array in lower_blend_equation_advanced.
authorKenneth Graunke <kenneth@whitecape.org>
Mon, 29 Aug 2016 04:43:54 +0000 (21:43 -0700)
committerKenneth Graunke <kenneth@whitecape.org>
Tue, 30 Aug 2016 20:11:00 +0000 (13:11 -0700)
Caught by Coverity.  Likely fixes real issues if an output component
is not present.

CID: 1372278
Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Iago Toral Quiroga <itoral@igalia.com>
src/compiler/glsl/lower_blend_equation_advanced.cpp

index a998df14027c65a463653eba90c0391642ecc51f..1d033924159f3a46db4891c5e15bb9d4a6bf18c3 100644 (file)
@@ -497,7 +497,7 @@ lower_blend_equation_advanced(struct gl_linked_shader *sh)
     * which writes a subset of the components, starting at location_frac.
     * The variables can't overlap, thankfully.
     */
-   ir_variable *outputs[4];
+   ir_variable *outputs[4] = { NULL, NULL, NULL, NULL };
    foreach_in_list(ir_instruction, ir, sh->ir) {
       ir_variable *var = ir->as_variable();
       if (!var || var->data.mode != ir_var_shader_out)