Skip to content

Commit

Permalink
xmb: Prevent crashes when resizing to a tiny window.
Browse files Browse the repository at this point in the history
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 libretro#8260
  • Loading branch information
orbea committed Feb 13, 2019
1 parent 3b131ee commit ee98a59
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion menu/drivers/xmb.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit ee98a59

Please sign in to comment.