svga: move LIST_INITHEAD(dirty_buffers) earlier in svga_context_create()
authorBrian Paul <brianp@vmware.com>
Wed, 9 Apr 2014 17:35:54 +0000 (11:35 -0600)
committerBrian Paul <brianp@vmware.com>
Wed, 9 Apr 2014 18:02:03 +0000 (12:02 -0600)
Fixes a crash in svga_context_flush_buffers() if we use the 'draw' module
for AA lines (when the device doesn't support that feature).  We need to
initialize this list before we setup the swtnl pieces.

Found/fixed by Charmaine Lee.

Cc: "10.0" <mesa-stable@lists.freedesktop.org>
Reviewed-by: Thomas Hellstrom <thellstrom@vmware.com>
Reviewed-by: Jakob Bornecrantz <jakob@vmware.com>
src/gallium/drivers/svga/svga_context.c

index 0ba09ce..8389384 100644 (file)
@@ -123,6 +123,8 @@ struct pipe_context *svga_context_create( struct pipe_screen *screen,
    if (svga == NULL)
       goto no_svga;
 
+   LIST_INITHEAD(&svga->dirty_buffers);
+
    svga->pipe.screen = screen;
    svga->pipe.priv = priv;
    svga->pipe.destroy = svga_destroy;
@@ -185,8 +187,6 @@ struct pipe_context *svga_context_create( struct pipe_screen *screen,
 
    svga->dirty = ~0;
 
-   LIST_INITHEAD(&svga->dirty_buffers);
-
    check_for_workarounds(svga);
 
    return &svga->pipe;