From a27f2fbb3aa2f4b77e0d6fe1032c8045a40c2840 Mon Sep 17 00:00:00 2001 From: jp9000 Date: Sat, 12 Jul 2014 11:59:46 -0700 Subject: [PATCH] Fix potentially uninitialized variable warnings --- libobs-opengl/gl-windows.c | 7 ++++--- libobs/graphics/bounds.c | 4 ++-- libobs/obs-source.c | 2 +- 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/libobs-opengl/gl-windows.c b/libobs-opengl/gl-windows.c index 0288f03af..1d2272a07 100644 --- a/libobs-opengl/gl-windows.c +++ b/libobs-opengl/gl-windows.c @@ -502,11 +502,12 @@ void device_load_swapchain(device_t device, swapchain_t swap) device->cur_swap = swap; - if (swap) + if (swap) { hdc = swap->wi->hdc; - if (!wgl_make_current(hdc, device->plat->hrc)) - blog(LOG_ERROR, "device_load_swapchain (GL) failed"); + if (!wgl_make_current(hdc, device->plat->hrc)) + blog(LOG_ERROR, "device_load_swapchain (GL) failed"); + } } void device_present(device_t device) diff --git a/libobs/graphics/bounds.c b/libobs/graphics/bounds.c index 15aa37cbb..c825b326d 100644 --- a/libobs/graphics/bounds.c +++ b/libobs/graphics/bounds.c @@ -86,7 +86,7 @@ void bounds_get_center(struct vec3 *dst, const struct bounds *b) void bounds_transform(struct bounds *dst, const struct bounds *b, const struct matrix4 *m) { - struct bounds temp; + struct bounds temp = {0}; bool b_init = false; int i; @@ -123,7 +123,7 @@ void bounds_transform(struct bounds *dst, const struct bounds *b, void bounds_transform3x4(struct bounds *dst, const struct bounds *b, const struct matrix3 *m) { - struct bounds temp; + struct bounds temp = {0}; bool b_init = false; int i; diff --git a/libobs/obs-source.c b/libobs/obs-source.c index 0b434ed1b..d5459b1d4 100644 --- a/libobs/obs-source.c +++ b/libobs/obs-source.c @@ -997,7 +997,7 @@ static void obs_source_draw_async_texture(struct obs_source *source) bool limited_range = yuv && !source->async_full_range; const char *type = yuv ? "DrawMatrix" : "Draw"; bool def_draw = (!effect); - technique_t tech; + technique_t tech = NULL; if (def_draw) { effect = obs_get_default_effect();