panfrost: Sanity check tiler polygon list size

Signed-off-by: Alyssa Rosenzweig <alyssa.rosenzweig@collabora.com>
This commit is contained in:
Alyssa Rosenzweig 2019-06-14 07:21:05 -07:00
parent 953cc4b540
commit e2c2ccd5b8
1 changed files with 5 additions and 0 deletions

View File

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