Safety checks for accessing video_poke function pointers
This commit is contained in:
parent
67e7628568
commit
f23e41bd17
|
@ -107,7 +107,7 @@ static void rmenu_render_messagebox(void *data, const char *message)
|
||||||
font_parms.scale = FONT_SIZE_NORMAL;
|
font_parms.scale = FONT_SIZE_NORMAL;
|
||||||
font_parms.color = WHITE;
|
font_parms.color = WHITE;
|
||||||
|
|
||||||
if (driver.video_poke->set_osd_msg)
|
if (driver.video_poke && driver.video_poke->set_osd_msg)
|
||||||
driver.video_poke->set_osd_msg(driver.video_data, msg, &font_parms);
|
driver.video_poke->set_osd_msg(driver.video_data, msg, &font_parms);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -234,7 +234,7 @@ static void rmenu_render(void *data)
|
||||||
font_parms.scale = FONT_SIZE_NORMAL;
|
font_parms.scale = FONT_SIZE_NORMAL;
|
||||||
font_parms.color = WHITE;
|
font_parms.color = WHITE;
|
||||||
|
|
||||||
if (driver.video_poke->set_osd_msg)
|
if (driver.video_poke && driver.video_poke->set_osd_msg)
|
||||||
driver.video_poke->set_osd_msg(driver.video_data, title_buf, &font_parms);
|
driver.video_poke->set_osd_msg(driver.video_data, title_buf, &font_parms);
|
||||||
|
|
||||||
char title_msg[64];
|
char title_msg[64];
|
||||||
|
@ -257,7 +257,7 @@ static void rmenu_render(void *data)
|
||||||
|
|
||||||
snprintf(title_msg, sizeof(title_msg), "%s - %s %s", PACKAGE_VERSION, core_name, core_version);
|
snprintf(title_msg, sizeof(title_msg), "%s - %s %s", PACKAGE_VERSION, core_name, core_version);
|
||||||
|
|
||||||
if (driver.video_poke->set_osd_msg)
|
if (driver.video_poke && driver.video_poke->set_osd_msg)
|
||||||
driver.video_poke->set_osd_msg(driver.video_data, title_msg, &font_parms);
|
driver.video_poke->set_osd_msg(driver.video_data, title_msg, &font_parms);
|
||||||
|
|
||||||
size_t i, j;
|
size_t i, j;
|
||||||
|
@ -372,12 +372,12 @@ static void rmenu_render(void *data)
|
||||||
font_parms.scale = FONT_SIZE_NORMAL;
|
font_parms.scale = FONT_SIZE_NORMAL;
|
||||||
font_parms.color = WHITE;
|
font_parms.color = WHITE;
|
||||||
|
|
||||||
if (driver.video_poke->set_osd_msg)
|
if (driver.video_poke && driver.video_poke->set_osd_msg)
|
||||||
driver.video_poke->set_osd_msg(driver.video_data, message, &font_parms);
|
driver.video_poke->set_osd_msg(driver.video_data, message, &font_parms);
|
||||||
|
|
||||||
font_parms.x = POSITION_EDGE_CENTER + POSITION_OFFSET;
|
font_parms.x = POSITION_EDGE_CENTER + POSITION_OFFSET;
|
||||||
|
|
||||||
if (driver.video_poke->set_osd_msg)
|
if (driver.video_poke && driver.video_poke->set_osd_msg)
|
||||||
driver.video_poke->set_osd_msg(driver.video_data, type_str_buf, &font_parms);
|
driver.video_poke->set_osd_msg(driver.video_data, type_str_buf, &font_parms);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -643,7 +643,7 @@ static int menu_viewport_iterate(void *data, unsigned action)
|
||||||
else if (custom->height >= (unsigned)stride_y)
|
else if (custom->height >= (unsigned)stride_y)
|
||||||
custom->height -= stride_y;
|
custom->height -= stride_y;
|
||||||
|
|
||||||
if (driver.video_poke->apply_state_changes)
|
if (driver.video_poke && driver.video_poke->apply_state_changes)
|
||||||
driver.video_poke->apply_state_changes(driver.video_data);
|
driver.video_poke->apply_state_changes(driver.video_data);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -657,7 +657,7 @@ static int menu_viewport_iterate(void *data, unsigned action)
|
||||||
else
|
else
|
||||||
custom->height += stride_y;
|
custom->height += stride_y;
|
||||||
|
|
||||||
if (driver.video_poke->apply_state_changes)
|
if (driver.video_poke && driver.video_poke->apply_state_changes)
|
||||||
driver.video_poke->apply_state_changes(driver.video_data);
|
driver.video_poke->apply_state_changes(driver.video_data);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -670,7 +670,7 @@ static int menu_viewport_iterate(void *data, unsigned action)
|
||||||
else if (custom->width >= (unsigned)stride_x)
|
else if (custom->width >= (unsigned)stride_x)
|
||||||
custom->width -= stride_x;
|
custom->width -= stride_x;
|
||||||
|
|
||||||
if (driver.video_poke->apply_state_changes)
|
if (driver.video_poke && driver.video_poke->apply_state_changes)
|
||||||
driver.video_poke->apply_state_changes(driver.video_data);
|
driver.video_poke->apply_state_changes(driver.video_data);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -684,7 +684,7 @@ static int menu_viewport_iterate(void *data, unsigned action)
|
||||||
else
|
else
|
||||||
custom->width += stride_x;
|
custom->width += stride_x;
|
||||||
|
|
||||||
if (driver.video_poke->apply_state_changes)
|
if (driver.video_poke && driver.video_poke->apply_state_changes)
|
||||||
driver.video_poke->apply_state_changes(driver.video_data);
|
driver.video_poke->apply_state_changes(driver.video_data);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
@ -728,7 +728,7 @@ static int menu_viewport_iterate(void *data, unsigned action)
|
||||||
custom->height = vp.full_height - custom->y;
|
custom->height = vp.full_height - custom->y;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (driver.video_poke->apply_state_changes)
|
if (driver.video_poke && driver.video_poke->apply_state_changes)
|
||||||
driver.video_poke->apply_state_changes(driver.video_data);
|
driver.video_poke->apply_state_changes(driver.video_data);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
@ -785,7 +785,7 @@ static int menu_viewport_iterate(void *data, unsigned action)
|
||||||
aspectratio_lut[ASPECT_RATIO_CUSTOM].value =
|
aspectratio_lut[ASPECT_RATIO_CUSTOM].value =
|
||||||
(float)custom->width / custom->height;
|
(float)custom->width / custom->height;
|
||||||
|
|
||||||
if (driver.video_poke->apply_state_changes)
|
if (driver.video_poke && driver.video_poke->apply_state_changes)
|
||||||
driver.video_poke->apply_state_changes(driver.video_data);
|
driver.video_poke->apply_state_changes(driver.video_data);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
|
@ -881,7 +881,7 @@ static int menu_settings_iterate(void *data, unsigned action)
|
||||||
(float)custom->width / custom->height;
|
(float)custom->width / custom->height;
|
||||||
|
|
||||||
g_settings.video.aspect_ratio_idx = ASPECT_RATIO_CUSTOM;
|
g_settings.video.aspect_ratio_idx = ASPECT_RATIO_CUSTOM;
|
||||||
if (driver.video_poke->set_aspect_ratio)
|
if (driver.video_poke && driver.video_poke->set_aspect_ratio)
|
||||||
driver.video_poke->set_aspect_ratio(driver.video_data,
|
driver.video_poke->set_aspect_ratio(driver.video_data,
|
||||||
g_settings.video.aspect_ratio_idx);
|
g_settings.video.aspect_ratio_idx);
|
||||||
}
|
}
|
||||||
|
|
2
gfx/gl.c
2
gfx/gl.c
|
@ -2185,7 +2185,9 @@ static void *gl_init(const video_info_t *video, const input_driver_t **input, vo
|
||||||
if (input && input_data)
|
if (input && input_data)
|
||||||
context_input_driver_func(input, input_data);
|
context_input_driver_func(input, input_data);
|
||||||
|
|
||||||
|
#ifndef RARCH_CONSOLE
|
||||||
if (g_settings.video.font_enable)
|
if (g_settings.video.font_enable)
|
||||||
|
#endif
|
||||||
{
|
{
|
||||||
gl->font_ctx = gl_font_init_first(gl, g_settings.video.font_path, g_settings.video.font_size,
|
gl->font_ctx = gl_font_init_first(gl, g_settings.video.font_path, g_settings.video.font_size,
|
||||||
gl->win_width, gl->win_height);
|
gl->win_width, gl->win_height);
|
||||||
|
|
Loading…
Reference in New Issue