xmb: Prevent crashes when resizing to a tiny window.

If the user resized their RetroArch window while using xmb it would
initiate a context_reset to scale xmb. When the window is too small
this would result in invalid pointers and a crash in the video driver.

This makes it so that when the window is too small it will skip the
context_reset and not crash. The window at this size is not really
useful to scale anyways.

Fixes https://github.com/libretro/RetroArch/issues/8260
This commit is contained in:
orbea 2019-02-12 09:37:05 -08:00
parent 3b131ee2da
commit ee98a595ca

View File

@ -3156,7 +3156,7 @@ static void xmb_render(void *data, bool is_idle)
scale_factor = (settings->uints.menu_xmb_scale_factor * (float)width) / (1920.0 * 100);
if (scale_factor != xmb->previous_scale_factor)
if (scale_factor >= 0.1f && scale_factor != xmb->previous_scale_factor)
xmb_context_reset_internal(xmb, video_driver_is_threaded(),
false);