fix null deref

This commit is contained in:
Brad Parker 2018-08-18 01:10:05 -04:00
parent c59cbfc4e8
commit dfd85125ad
2 changed files with 14 additions and 11 deletions

View File

@ -1066,7 +1066,7 @@ static void command_event_init_controllers(void)
break; break;
} }
if (set_controller && i < info->ports.size) if (set_controller && info && i < info->ports.size)
{ {
pad.device = device; pad.device = device;
pad.port = i; pad.port = i;

View File

@ -543,17 +543,20 @@ static void materialui_render_messagebox(materialui_handle_t *mui,
} }
} }
menu_display_set_alpha(body_bg_color, 1.0); if (body_bg_color)
{
menu_display_set_alpha(body_bg_color, 1.0);
menu_display_draw_quad( menu_display_draw_quad(
video_info, video_info,
x - longest_width / 2.0 - mui->margin * 2.0, x - longest_width / 2.0 - mui->margin * 2.0,
y - line_height / 2.0 - mui->margin * 2.0, y - line_height / 2.0 - mui->margin * 2.0,
longest_width + mui->margin * 4.0, longest_width + mui->margin * 4.0,
line_height * list->size + mui->margin * 4.0, line_height * list->size + mui->margin * 4.0,
width, width,
height, height,
&body_bg_color[0]); &body_bg_color[0]);
}
/* print each line */ /* print each line */
for (i = 0; i < list->size; i++) for (i = 0; i < list->size; i++)