From 0f4e3d6c3988ab4a582706d9a4a1d6d6f5a9d9a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tapani=20P=C3=A4lli?= Date: Wed, 4 Jun 2014 10:06:59 +0300 Subject: [PATCH] i965: use _mesa_align_malloc in intel_miptree_map_movntdqa MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This fixes case where we have 1x1 size buffer and misalignment is 0. Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=79616 Signed-off-by: Tapani Pälli --- src/mesa/drivers/dri/i965/intel_mipmap_tree.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c index b7d86a3..dd7e57a 100644 --- a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c +++ b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c @@ -1874,7 +1874,7 @@ intel_miptree_map_movntdqa(struct brw_context *brw, map->stride = ALIGN(misalignment + width_bytes, 16); - map->buffer = malloc(map->stride * map->h); + map->buffer = _mesa_align_malloc(map->stride * map->h, 16); /* Offset the destination so it has the same misalignment as src. */ map->ptr = map->buffer + misalignment; @@ -1897,7 +1897,7 @@ intel_miptree_unmap_movntdqa(struct brw_context *brw, unsigned int level, unsigned int slice) { - free(map->buffer); + _mesa_align_free(map->buffer); map->buffer = NULL; map->ptr = NULL; } -- 1.9.3