Mesa (master): panfrost: Sanity check tiler polygon list size

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Mon Jun 17 15:25:47 UTC 2019


Module: Mesa
Branch: master
Commit: e2c2ccd5b8e38d6899bf9aea8fc7f17f3f6442e5
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=e2c2ccd5b8e38d6899bf9aea8fc7f17f3f6442e5

Author: Alyssa Rosenzweig <alyssa.rosenzweig at collabora.com>
Date:   Fri Jun 14 07:21:05 2019 -0700

panfrost: Sanity check tiler polygon list size

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 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;
 




More information about the mesa-commit mailing list