diff options
author | Michel Dänzer <[email protected]> | 2007-06-05 19:55:53 +0200 |
---|---|---|
committer | Michel Dänzer <[email protected]> | 2007-08-02 12:14:03 +0200 |
commit | a8964ca89ef3011f57ef4c73f15478967f282fad (patch) | |
tree | 53a7a5e320fc13ca15d79b8a8e96d185ed2bad44 /src | |
parent | 4f0e92d07cf49719d94ceb7530a9f6ef0bbdbc54 (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.
Diffstat (limited to 'src')
-rw-r--r-- | src/mesa/drivers/dri/i915tex/intel_tex_image.c | 6 |
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 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; |