From 463cc35a43e54dc634fef73bce799f6244bee426 Mon Sep 17 00:00:00 2001 From: Chad Versace Date: Mon, 3 Nov 2014 10:29:20 -0800 Subject: [PATCH] wip! i965: Fix segfault in WebGL Conformance TODO: Write a proper fix. Prevent WebGL Conformance test texture-size-limit from segfaulting on Chrome. Fixes: https://bugs.freedesktop.org/show_bug.cgi?id=78770 --- src/mesa/drivers/dri/i965/intel_mipmap_tree.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c index 59700ed..229485c 100644 --- a/src/mesa/drivers/dri/i965/intel_mipmap_tree.c +++ b/src/mesa/drivers/dri/i965/intel_mipmap_tree.c @@ -1664,7 +1664,13 @@ intel_miptree_map_gtt(struct brw_context *brw, y += image_y; map->stride = mt->region->pitch; - map->ptr = base + y * map->stride + x * mt->cpp; + + /* TODO(chadv): Fix this correctly + * + * Prevent WebGL Conformance test texture-size-limit from segfaulting on Chrome. + * See [https://bugs.freedesktop.org/show_bug.cgi?id=78770]. + */ + map->ptr = base + (intptr_t) y * (intptr_t) map->stride + (intptr_t) x * (intptr_t) mt->cpp; } DBG("%s: %d,%d %dx%d from mt %p (%s) %d,%d = %p/%d\n", __FUNCTION__, -- 2.1.2.1.g5433a3e