From: Alyssa Rosenzweig Date: Fri, 14 Jun 2019 14:21:05 +0000 (-0700) Subject: panfrost: Sanity check tiler polygon list size X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=e2c2ccd5b8e38d6899bf9aea8fc7f17f3f6442e5;p=mesa.git panfrost: Sanity check tiler polygon list size Signed-off-by: Alyssa Rosenzweig --- 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;