i965: Fix infinite loop regression in intel_miptree_all_slices_resolve.
authorKenneth Graunke <kenneth@whitecape.org>
Wed, 4 Jan 2012 23:45:49 +0000 (15:45 -0800)
committerKenneth Graunke <kenneth@whitecape.org>
Wed, 4 Jan 2012 23:51:51 +0000 (15:51 -0800)
commita0a0a909f21acfcddaab603079ba98266e8daf0e
treeecef91dbc1d103e554ee4256f75baf9b558cd34b
parentfbbbc8c04e2462a0ae272d81e61eee5f85f08aa6
i965: Fix infinite loop regression in intel_miptree_all_slices_resolve.

Commit 0ed11e333147e280208d9d0b3ff3f39970547643 fixed a "use after free"
bug by getting the next pointer before deleting the current node.

Unfortunately, it also made "next" never get updated if i->need != need.

Fixes infinite loops in piglit tests fbo-depth-array and fbo-depthtex.

Signed-off-by: Kenneth Graunke <kenneth@whitecape.org>
Reviewed-by: Eric Anholt <eric@anholt.net>
Reviewed-by: Ian Romanick <ian.d.romanick@intel.com>
src/mesa/drivers/dri/intel/intel_mipmap_tree.c