diff options
author | Michel Dänzer <[email protected]> | 2017-07-13 01:21:00 -0600 |
---|---|---|
committer | Brian Paul <[email protected]> | 2017-07-13 09:26:20 -0600 |
commit | 655a32f729a46176c1fc0c1727b33c15c69cad78 (patch) | |
tree | cb7656f3e354b2ae1b31d66a4db3e502de1a11d2 /src/mesa/state_tracker/st_manager.c | |
parent | 254fa3dbf57981495f87d0d7e3ef112e04d74cf8 (diff) |
st/mesa: Handle st_framebuffer_create returning NULL
st_framebuffer_create returns NULL if stfbi == NULL or
st_framebuffer_add_renderbuffer returns false for the colour buffer.
Fixes Xorg crashing on startup using glamor on radeonsi.
Fixes: 147d7fb772a7 ("st/mesa: add a winsys buffers list in st_context")
Bugzilla: https://bugs.freedesktop.org/show_bug.cgi?id=101775
Signed-off-by: Michel Dänzer <[email protected]>
Reviewed-by: Nicolai Hähnle <[email protected]>
Reviewed-by: Brian Paul <[email protected]>
Diffstat (limited to 'src/mesa/state_tracker/st_manager.c')
-rw-r--r-- | src/mesa/state_tracker/st_manager.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/src/mesa/state_tracker/st_manager.c b/src/mesa/state_tracker/st_manager.c index de16a3a2cf0..348b456c4d1 100644 --- a/src/mesa/state_tracker/st_manager.c +++ b/src/mesa/state_tracker/st_manager.c @@ -802,10 +802,12 @@ st_framebuffer_reuse_or_create(struct st_context *st, if (stfb == NULL) { cur = st_framebuffer_create(st, stfbi); - /* add to the context's winsys buffers list */ - LIST_ADD(&cur->head, &st->winsys_buffers); + if (cur) { + /* add to the context's winsys buffers list */ + LIST_ADD(&cur->head, &st->winsys_buffers); - st_framebuffer_reference(&stfb, cur); + st_framebuffer_reference(&stfb, cur); + } } return stfb; |