From: Brian Paul Date: Sat, 23 Jan 2010 00:56:35 +0000 (-0700) Subject: st/mesa: fix incorrect freeing of drawpixels vertex shaders X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=46c7cd665c9bc93e7254771b16b010fb10ce3707;p=mesa.git st/mesa: fix incorrect freeing of drawpixels vertex shaders These shaders are not st_vertex_shaders, but tgsi ureg shaders. Fixes fd.o bug 25959. --- diff --git a/src/mesa/state_tracker/st_cb_drawpixels.c b/src/mesa/state_tracker/st_cb_drawpixels.c index 4cec2598449..7afdc31ede9 100644 --- a/src/mesa/state_tracker/st_cb_drawpixels.c +++ b/src/mesa/state_tracker/st_cb_drawpixels.c @@ -1132,6 +1132,8 @@ st_destroy_drawpix(struct st_context *st) { st_reference_fragprog(st, &st->drawpix.z_shader, NULL); st_reference_fragprog(st, &st->pixel_xfer.combined_prog, NULL); - st_reference_vertprog(st, &st->drawpix.vert_shaders[0], NULL); - st_reference_vertprog(st, &st->drawpix.vert_shaders[1], NULL); + if (st->drawpix.vert_shaders[0]) + free(st->drawpix.vert_shaders[0]); + if (st->drawpix.vert_shaders[1]) + free(st->drawpix.vert_shaders[1]); } diff --git a/src/mesa/state_tracker/st_context.h b/src/mesa/state_tracker/st_context.h index 2c4943cfb0a..50e98d7146a 100644 --- a/src/mesa/state_tracker/st_context.h +++ b/src/mesa/state_tracker/st_context.h @@ -159,7 +159,7 @@ struct st_context /** for glDraw/CopyPixels */ struct { struct st_fragment_program *z_shader; - struct st_vertex_program *vert_shaders[2]; + void *vert_shaders[2]; /**< ureg shaders */ } drawpix; /** for glClear */