From: Michel Dänzer Date: Tue, 5 Jun 2007 17:55:53 +0000 (+0200) Subject: i915tex: Better attempt to release miptree when overriding texture image. X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=08a2cc2d234386550c0810567f58eb4d5fb68945;p=mesa.git 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. --- 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;