Signed-off-by: Alyssa Rosenzweig <[email protected]>
---
 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

_______________________________________________
mesa-dev mailing list
[email protected]
https://lists.freedesktop.org/mailman/listinfo/mesa-dev

Reply via email to