[Mesa-dev] [PATCH 09/11] panfrost: Sanity check tiler polygon list size
Alyssa Rosenzweig
alyssa.rosenzweig at collabora.com
Fri Jun 14 17:04:41 UTC 2019
Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig at collabora.com>
---
src/gallium/drivers/panfrost/pan_context.c | 5 +++++
1 file changed, 5 insertions(+)
diff --git a/src/gallium/drivers/panfrost/pan_context.c b/src/gallium/drivers/panfrost/pan_context.c
index a30b9e29701..d1e5b4ce647 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;
--
2.20.1
More information about the mesa-dev
mailing list