mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-26 03:48:12 +02:00
glsl: Make sure not to dereference NULL
In this bit of code point_five can be NULL if the expression is not a constant. This fixes it to match the pattern of the rest of the chunk of code so that it checks for NULLs. Cc: Matt Turner <mattst88@gmail.com> Cc: "10.6" <mesa-stable@lists.freedesktop.org> Reviewed-by: Matt Turner <mattst88@gmail.com>
This commit is contained in:
parent
18039078e0
commit
86a3557d7c
1 changed files with 1 additions and 1 deletions
|
|
@ -589,7 +589,7 @@ ir_algebraic_visitor::handle_expression(ir_expression *ir)
|
|||
continue;
|
||||
|
||||
ir_constant *point_five = add_expr->operands[1 - j]->as_constant();
|
||||
if (!point_five->is_value(0.5, 0))
|
||||
if (!point_five || !point_five->is_value(0.5, 0))
|
||||
continue;
|
||||
|
||||
if (abs_expr->operands[0]->equals(sign_expr->operands[0])) {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue