llvmpipe: Fix pointer dereference after free.
authorJosé Fonseca <jfonseca@vmware.com>
Fri, 18 Jun 2010 16:37:37 +0000 (17:37 +0100)
committerJosé Fonseca <jfonseca@vmware.com>
Fri, 18 Jun 2010 16:37:37 +0000 (17:37 +0100)
src/gallium/drivers/llvmpipe/lp_state_fs.c

index 48c7754..c3ecd77 100644 (file)
@@ -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);