mirror of
https://github.com/libretro/RetroArch
synced 2025-04-10 15:45:19 +00:00
Prevent division by zero in gfx_set_viewport
This commit is contained in:
parent
4d48c5a6b8
commit
535f130891
@ -251,12 +251,14 @@ void gfx_set_config_viewport(void)
|
|||||||
if (geom->aspect_ratio > 0.0f && g_settings.video.aspect_ratio_auto)
|
if (geom->aspect_ratio > 0.0f && g_settings.video.aspect_ratio_auto)
|
||||||
aspectratio_lut[ASPECT_RATIO_CONFIG].value = geom->aspect_ratio;
|
aspectratio_lut[ASPECT_RATIO_CONFIG].value = geom->aspect_ratio;
|
||||||
else
|
else
|
||||||
#ifdef PSP
|
{
|
||||||
// Get around division by zero error
|
// Get around division by zero errors
|
||||||
aspectratio_lut[ASPECT_RATIO_CONFIG].value = 1.0f; // 1:1 PAR.
|
if (geom->base_width == 0)
|
||||||
#else
|
geom->base_width = 1;
|
||||||
|
if (geom->base_height == 0)
|
||||||
|
geom->base_height = 1;
|
||||||
aspectratio_lut[ASPECT_RATIO_CONFIG].value = (float)geom->base_width / geom->base_height; // 1:1 PAR.
|
aspectratio_lut[ASPECT_RATIO_CONFIG].value = (float)geom->base_width / geom->base_height; // 1:1 PAR.
|
||||||
#endif
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
aspectratio_lut[ASPECT_RATIO_CONFIG].value = g_settings.video.aspect_ratio;
|
aspectratio_lut[ASPECT_RATIO_CONFIG].value = g_settings.video.aspect_ratio;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user