st/mesa: fix incorrect freeing of drawpixels vertex shaders
authorBrian Paul <brianp@vmware.com>
Sat, 23 Jan 2010 00:56:35 +0000 (17:56 -0700)
committerBrian Paul <brianp@vmware.com>
Sat, 23 Jan 2010 00:56:37 +0000 (17:56 -0700)
These shaders are not st_vertex_shaders, but tgsi ureg shaders.
Fixes fd.o bug 25959.

src/mesa/state_tracker/st_cb_drawpixels.c
src/mesa/state_tracker/st_context.h

index 4cec25984497a49eb3b2a31c503aa65dcdc90ed8..7afdc31ede98e3298f96b7660b9465eb32467074 100644 (file)
@@ -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]);
 }
index 2c4943cfb0a2fa285eaec9fe0d2044c69f915542..50e98d7146a6626225082bfb0a85482f2b4f8c85 100644 (file)
@@ -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 */