summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/mesa/state_tracker/st_manager.c8
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;