From 08a2cc2d234386550c0810567f58eb4d5fb68945 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Michel=20D=C3=A4nzer?= Date: Tue, 5 Jun 2007 19:55:53 +0200 Subject: [PATCH] i915tex: Better attempt to release miptree when overriding texture image. The previous approach could lead to crashes in FBO code that dereferences the miptree struct pointer unconditionally. --- src/mesa/drivers/dri/i915tex/intel_tex_image.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/mesa/drivers/dri/i915tex/intel_tex_image.c b/src/mesa/drivers/dri/i915tex/intel_tex_image.c index abab90cc066..f790b1e6f73 100644 --- a/src/mesa/drivers/dri/i915tex/intel_tex_image.c +++ b/src/mesa/drivers/dri/i915tex/intel_tex_image.c @@ -378,9 +378,6 @@ intelTexImage(GLcontext * ctx, assert(!intelObj->mt); } - if (!pixels) - return; - if (!intelObj->mt) { guess_and_alloc_mipmap_tree(intel, intelObj, intelImage); if (!intelObj->mt) { @@ -682,6 +679,9 @@ intelSetTexOffset(__DRIcontext *pDRICtx, GLint texname, if (!intelObj) return; + if (intelObj->mt) + intel_miptree_release(intel, &intelObj->mt); + intelObj->imageOverride = GL_TRUE; intelObj->depthOverride = depth; intelObj->pitchOverride = pitch; -- 2.30.2