glsl: Make sure not to dereference NULL.
authorMatt Turner <mattst88@gmail.com>
Wed, 1 Apr 2015 17:24:26 +0000 (10:24 -0700)
committerMatt Turner <mattst88@gmail.com>
Wed, 1 Apr 2015 19:25:29 +0000 (12:25 -0700)
Found by Coverity.

src/glsl/opt_algebraic.cpp

index a940d2f1cd4552f1d9094d405c44d8d0415de9b1..3d2f2ca0bab4f28a34223bc6edded3412480549a 100644 (file)
@@ -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();