mirror of
https://github.com/libretro/RetroArch
synced 2025-03-28 19:20:35 +00:00
Guard against aspect ratio index being out of bounds
This commit is contained in:
parent
3e53783dc8
commit
59571b5aa4
11
retroarch.c
11
retroarch.c
@ -17754,8 +17754,15 @@ static bool video_driver_init_internal(bool *video_is_threaded)
|
||||
(float)custom_vp->width / custom_vp->height : default_aspect;
|
||||
}
|
||||
|
||||
video_driver_set_aspect_ratio_value(
|
||||
aspectratio_lut[settings->uints.video_aspect_ratio_idx].value);
|
||||
{
|
||||
/* Guard against aspect ratio index possibly being out of bounds */
|
||||
unsigned new_aspect_idx = settings->uints.video_aspect_ratio_idx;
|
||||
if (new_aspect_idx > ASPECT_RATIO_END)
|
||||
new_aspect_idx = settings->uints.video_aspect_ratio_idx = 0;
|
||||
|
||||
video_driver_set_aspect_ratio_value(
|
||||
aspectratio_lut[new_aspect_idx].value);
|
||||
}
|
||||
|
||||
if (settings->bools.video_fullscreen|| retroarch_is_forced_fullscreen())
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user