summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAlyssa Rosenzweig <[email protected]>2019-06-14 07:21:05 -0700
committerAlyssa Rosenzweig <[email protected]>2019-06-17 07:59:14 -0700
commite2c2ccd5b8e38d6899bf9aea8fc7f17f3f6442e5 (patch)
tree19fb1a64b7000d01dc7e6ce2c62736ae917a183e
parent953cc4b540027f6bb43030615eb0e85699784b01 (diff)
panfrost: Sanity check tiler polygon list size
Signed-off-by: Alyssa Rosenzweig <[email protected]>
-rw-r--r--src/gallium/drivers/panfrost/pan_context.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/gallium/drivers/panfrost/pan_context.c b/src/gallium/drivers/panfrost/pan_context.c
index 3c9c8a9f8e6..225561a51d1 100644
--- a/src/gallium/drivers/panfrost/pan_context.c
+++ b/src/gallium/drivers/panfrost/pan_context.c
@@ -178,6 +178,11 @@ panfrost_emit_mfbd(struct panfrost_context *ctx)
unsigned body_size = panfrost_tiler_body_size(
width, height, framebuffer.tiler_hierarchy_mask);
+ /* Sanity check */
+
+ unsigned total_size = header_size + body_size;
+ assert(ctx->misc_0.size >= total_size);
+
framebuffer.tiler_polygon_list_body =
framebuffer.tiler_polygon_list + header_size;