st/mesa: use pipe_sampler_view_release()
authorJonathan Liu <net147@gmail.com>
Sat, 14 Dec 2013 14:15:00 +0000 (07:15 -0700)
committerBrian Paul <brianp@vmware.com>
Sun, 22 Dec 2013 14:07:07 +0000 (07:07 -0700)
This fixes a crash where old_view->context was already freed in the
pipe_sampler_view_reference function contained in
src/gallium/auxiliary/utils/u_inlines.h. As a result, the
sampler_view_destroy function pointer contained 0xfeeefeee indicating
freed heap memory.

Cc: "10.0" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Jonathan Liu <net147@gmail.com>
Reviewed-by: Brian Paul <brianp@vmware.com>
src/mesa/state_tracker/st_atom_texture.c

index d79e04cf49c859e5caea7ceac5fec87fb9c1cd37..bd0a22dde4259fdceb917ef0041920f84ec9a444 100644 (file)
@@ -255,7 +255,7 @@ update_single_texture(struct st_context *st,
                                stObj->base.DepthMode) ||
          (view_format != stObj->sampler_view->format) ||
          stObj->base.BaseLevel != stObj->sampler_view->u.tex.first_level) {
-        pipe_sampler_view_reference(&stObj->sampler_view, NULL);
+        pipe_sampler_view_release(pipe, &stObj->sampler_view);
       }
    }