From 05ac1aea2ce30c46d98abc36412ae19d9e29c04c Mon Sep 17 00:00:00 2001 From: jp9000 Date: Fri, 26 Sep 2014 15:24:14 -0700 Subject: [PATCH] Do not modify gs_init_data parameter in gs_create --- libobs/graphics/graphics.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/libobs/graphics/graphics.c b/libobs/graphics/graphics.c index 6e6ba2eb3..d4aec94be 100644 --- a/libobs/graphics/graphics.c +++ b/libobs/graphics/graphics.c @@ -119,13 +119,14 @@ static bool graphics_init(struct graphics_subsystem *graphics) int gs_create(graphics_t **pgraphics, const char *module, struct gs_init_data *data) { + struct gs_init_data new_data = *data; int errcode = GS_ERROR_FAIL; graphics_t *graphics = bzalloc(sizeof(struct graphics_subsystem)); pthread_mutex_init_value(&graphics->mutex); - if (!data->num_backbuffers) - data->num_backbuffers = 1; + if (!new_data.num_backbuffers) + new_data.num_backbuffers = 1; graphics->module = os_dlopen(module); if (!graphics->module) { @@ -137,7 +138,7 @@ int gs_create(graphics_t **pgraphics, const char *module, module)) goto error; - errcode = graphics->exports.device_create(&graphics->device, data); + errcode = graphics->exports.device_create(&graphics->device, &new_data); if (errcode != GS_SUCCESS) goto error;