mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-06 09:28:07 +02:00
pan/midgard: Check for null consts
Valid shaders shouldn't hit this, but Coverity doesn't know that. CID 1458029: (FORWARD_NULL) Passing null pointer "consts" to "print_scalar_field", which dereferences it. Tomeu: Fix name of variable Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com> Signed-off-by: Tomeu Vizoso <tomeu.vizoso@collabora.com> Reviewed-by: Tomeu Vizoso <tomeu.vizoso@collabora.com> Part-of: <https://gitlab.freedesktop.org/mesa/mesa/merge_requests/3684>
This commit is contained in:
parent
8ec4028d40
commit
0f3eb7989b
1 changed files with 2 additions and 0 deletions
|
|
@ -337,6 +337,8 @@ print_scalar_constant(FILE *fp, unsigned src_binary,
|
|||
midgard_scalar_alu_src *src = (midgard_scalar_alu_src *)&src_binary;
|
||||
unsigned mod = 0;
|
||||
|
||||
assert(consts != NULL);
|
||||
|
||||
if (!midgard_is_integer_op(alu->op)) {
|
||||
if (src->abs)
|
||||
mod |= MIDGARD_FLOAT_MOD_ABS;
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue