[Mesa-dev] [PATCH 05/10] panfrost/midgard: Fix crash on unknown op

Alyssa Rosenzweig alyssa at rosenzweig.io
Wed May 1 03:42:05 UTC 2019


Signed-off-by: Alyssa Rosenzweig <alyssa at rosenzweig.io>
---
 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.20.1



More information about the mesa-dev mailing list