From 8540752665dc77660df4723d15fdd51cb83ae362 Mon Sep 17 00:00:00 2001 From: Toad King Date: Tue, 4 Sep 2012 18:20:31 -0400 Subject: [PATCH] (RARCH_CONSOLE) fix potentially uninitialized values in aspect_ratio --- console/rarch_console_video.c | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/console/rarch_console_video.c b/console/rarch_console_video.c index 734626e9bc..5c7505a5c8 100644 --- a/console/rarch_console_video.c +++ b/console/rarch_console_video.c @@ -82,18 +82,14 @@ void rarch_set_auto_viewport(unsigned width, unsigned height) void rarch_set_core_viewport() { - struct retro_system_av_info info; - if (!g_console.emulator_initialized) return; - retro_get_system_av_info(&info); - // fallback to 1:1 pixel ratio if none provided - if (info.geometry.aspect_ratio == 0.0) - aspectratio_lut[ASPECT_RATIO_CORE].value = (float) info.geometry.base_width / info.geometry.base_height; + if (g_extern.system.av_info.geometry.aspect_ratio == 0.0) + aspectratio_lut[ASPECT_RATIO_CORE].value = (float) g_extern.system.av_info.geometry.base_width / g_extern.system.av_info.geometry.base_height; else - aspectratio_lut[ASPECT_RATIO_CORE].value = info.geometry.aspect_ratio; + aspectratio_lut[ASPECT_RATIO_CORE].value = g_extern.system.av_info.geometry.aspect_ratio; } #if defined(HAVE_HLSL) || defined(HAVE_CG) || defined(HAVE_GLSL)