Mesa (master): llvmpipe: Fix pointer dereference after free.

Jose Fonseca jrfonseca at kemper.freedesktop.org
Fri Jun 18 09:38:14 PDT 2010


Module: Mesa
Branch: master
Commit: d7f4250333f3649d170d71bfdc5f2faba4e8c5f8
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=d7f4250333f3649d170d71bfdc5f2faba4e8c5f8

Author: José Fonseca <jfonseca at vmware.com>
Date:   Fri Jun 18 17:37:37 2010 +0100

llvmpipe: Fix pointer dereference after free.

---

 src/gallium/drivers/llvmpipe/lp_state_fs.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/src/gallium/drivers/llvmpipe/lp_state_fs.c b/src/gallium/drivers/llvmpipe/lp_state_fs.c
index 48c7754..c3ecd77 100644
--- a/src/gallium/drivers/llvmpipe/lp_state_fs.c
+++ b/src/gallium/drivers/llvmpipe/lp_state_fs.c
@@ -1079,8 +1079,9 @@ llvmpipe_delete_fs_state(struct pipe_context *pipe, void *fs)
 
    li = first_elem(&shader->variants);
    while(!at_end(&shader->variants, li)) {
+      struct lp_fs_variant_list_item *next = next_elem(li);
       remove_shader_variant(llvmpipe, li->base);
-      li = next_elem(li);
+      li = next;
    }
 
    assert(shader->variants_cached == 0);



More information about the mesa-commit mailing list