From 9559280fc30f46cd2fd675f8e84b26925d205813 Mon Sep 17 00:00:00 2001 From: Alyssa Rosenzweig Date: Tue, 30 Apr 2019 05:06:18 +0000 Subject: [PATCH] panfrost/midgard: Fix crash on unknown op Signed-off-by: Alyssa Rosenzweig --- src/gallium/drivers/panfrost/midgard/helpers.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/gallium/drivers/panfrost/midgard/helpers.h b/src/gallium/drivers/panfrost/midgard/helpers.h index 6d35f4de025..d2855cd89cd 100644 --- a/src/gallium/drivers/panfrost/midgard/helpers.h +++ b/src/gallium/drivers/panfrost/midgard/helpers.h @@ -264,6 +264,10 @@ static struct { static bool midgard_is_integer_op(int op) { - char prefix = alu_opcode_props[op].name[0]; - return (prefix == 'i') || (prefix == 'u'); + const char *name = alu_opcode_props[op].name; + + if (!name) + return false; + + return (name[0] == 'i') || (name[0] == 'u'); } -- 2.30.2