From e96d7a1489c1e4ddd66fc5c88c0fc603e1483e32 Mon Sep 17 00:00:00 2001 From: Brian Paul Date: Thu, 19 Nov 2015 10:39:09 -0700 Subject: [PATCH] svga: add some sanity check assertions in svga_buffer_transfer_map() MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Make sure y and z values of buffers are as expected. Reviewed-by: José Fonseca Reviewed-by: Charmaine Lee --- src/gallium/drivers/svga/svga_resource_buffer.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/gallium/drivers/svga/svga_resource_buffer.c b/src/gallium/drivers/svga/svga_resource_buffer.c index 71f2f4f2779..449cc149a81 100644 --- a/src/gallium/drivers/svga/svga_resource_buffer.c +++ b/src/gallium/drivers/svga/svga_resource_buffer.c @@ -80,6 +80,11 @@ svga_buffer_transfer_map(struct pipe_context *pipe, uint8_t *map; int64_t begin = os_time_get(); + assert(box->y == 0); + assert(box->z == 0); + assert(box->height == 1); + assert(box->depth == 1); + transfer = CALLOC_STRUCT(pipe_transfer); if (transfer == NULL) { return NULL; -- 2.30.2