pan/decode: Resolve crash with NULL attr/varyings
authorAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Thu, 8 Aug 2019 16:23:29 +0000 (09:23 -0700)
committerAlyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
Fri, 9 Aug 2019 18:50:45 +0000 (11:50 -0700)
This case needs more investigation, but this was found with geometry
shaders.

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
src/panfrost/pandecode/decode.c

index 78f6da6e56c64ecf7290a553c7afa15f67614314..60adec59699dd59266cad79e7ae2f3241a19da9f 100644 (file)
@@ -995,6 +995,11 @@ pandecode_attributes(const struct pandecode_mapped_memory *mem,
 {
         char *prefix = varying ? "varyings" : "attributes";
 
+        if (!addr) {
+                pandecode_msg("no %s\n", prefix);
+                return;
+        }
+
         union mali_attr *attr = pandecode_fetch_gpu_mem(mem, addr, sizeof(union mali_attr) * count);
 
         char base[128];