From 05f89f48ea5171af2aa19b1db29e5001bc636183 Mon Sep 17 00:00:00 2001 From: jp9000 Date: Fri, 26 Sep 2014 15:22:56 -0700 Subject: [PATCH] Ensure num_backbuffers > 0 in gs_swapchain_create --- libobs/graphics/graphics.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/libobs/graphics/graphics.c b/libobs/graphics/graphics.c index fecc97376..6e6ba2eb3 100644 --- a/libobs/graphics/graphics.c +++ b/libobs/graphics/graphics.c @@ -959,11 +959,16 @@ const char *gs_preprocessor_name(void) gs_swapchain_t *gs_swapchain_create(struct gs_init_data *data) { + struct gs_init_data new_data = *data; + graphics_t *graphics = thread_graphics; if (!graphics) return NULL; + if (new_data.num_backbuffers == 0) + new_data.num_backbuffers = 1; + return graphics->exports.device_swapchain_create(graphics->device, - data); + &new_data); } void gs_resize(uint32_t x, uint32_t y)