summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichel Dänzer <michel@tungstengraphics.com>2007-06-05 19:55:53 +0200
committerMichel Dänzer <michel@tungstengraphics.com>2007-06-05 19:55:53 +0200
commit08a2cc2d234386550c0810567f58eb4d5fb68945 (patch)
treef39458204d681bdcc9af7e80adebb6c5b16e8d85
parent89f070b3bbb86204306857b8cf690abbd56a939d (diff)
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.
-rw-r--r--src/mesa/drivers/dri/i915tex/intel_tex_image.c6
1 files 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 abab90cc06..f790b1e6f7 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;