st/mesa: fix a null pointer access
authorFrank Richter <frank.richter@dynardo.de>
Wed, 7 Jun 2017 12:40:23 +0000 (14:40 +0200)
committerBrian Paul <brianp@vmware.com>
Thu, 17 Aug 2017 00:32:41 +0000 (18:32 -0600)
Fixes crash with llvmpipe on Windows.

Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=102148
Cc: mesa-stable@lists.freedesktop.org
Reviewed-by: Brian Paul <brianp@vmware.com>
src/mesa/state_tracker/st_manager.c

index 617a691a67c33871a0c84d90feb9bc3d2986f2af..07c430dca45d0e53f9926afcf38c6941f4b61942 100644 (file)
@@ -634,7 +634,7 @@ st_context_flush(struct st_context_iface *stctxi, unsigned flags,
 
    st_flush(st, fence, pipe_flags);
 
-   if ((flags & ST_FLUSH_WAIT) && fence) {
+   if ((flags & ST_FLUSH_WAIT) && fence && *fence) {
       st->pipe->screen->fence_finish(st->pipe->screen, NULL, *fence,
                                      PIPE_TIMEOUT_INFINITE);
       st->pipe->screen->fence_reference(st->pipe->screen, fence, NULL);