From: Matt Turner Date: Wed, 1 Apr 2015 17:24:26 +0000 (-0700) Subject: glsl: Make sure not to dereference NULL. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=3384179f;p=mesa.git glsl: Make sure not to dereference NULL. Found by Coverity. --- diff --git a/src/glsl/opt_algebraic.cpp b/src/glsl/opt_algebraic.cpp index a940d2f1cd4..3d2f2ca0bab 100644 --- a/src/glsl/opt_algebraic.cpp +++ b/src/glsl/opt_algebraic.cpp @@ -574,6 +574,8 @@ ir_algebraic_visitor::handle_expression(ir_expression *ir) continue; ir_expression *add_expr = floor_expr->operands[0]->as_expression(); + if (!add_expr) + continue; for (int j = 0; j < 2; j++) { ir_expression *abs_expr = add_expr->operands[j]->as_expression();