From ee98a595ca4e533f2cb76ea32787375015da72c3 Mon Sep 17 00:00:00 2001 From: orbea Date: Tue, 12 Feb 2019 09:37:05 -0800 Subject: [PATCH] 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 --- menu/drivers/xmb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/menu/drivers/xmb.c b/menu/drivers/xmb.c index 9fb8a70b57..e9cedd535b 100644 --- a/menu/drivers/xmb.c +++ b/menu/drivers/xmb.c @@ -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);