Prevent segfault in overlay function

This commit is contained in:
twinaphex 2015-02-15 06:57:02 +01:00
parent 20fbecebe7
commit 8ace562670
2 changed files with 12 additions and 5 deletions

View File

@ -810,6 +810,9 @@ void input_overlay_post_poll(input_overlay_t *ol, float opacity)
{
size_t i;
if (!ol)
return;
input_overlay_set_alpha_mod(ol, opacity);
for (i = 0; i < ol->active->size; i++)

View File

@ -259,13 +259,17 @@ void input_keyboard_event(bool down, unsigned code,
if (!down)
return;
if (device == RETRO_DEVICE_POINTER && code != 0x12d)
switch (device)
{
if (!input_keyboard_line_event(g_keyboard_line, (char)code))
return;
case RETRO_DEVICE_POINTER:
if (!input_keyboard_line_event(g_keyboard_line, (code != 0x12d) ? (char)code : character))
return;
break;
default:
if (!input_keyboard_line_event(g_keyboard_line, character))
return;
break;
}
else if (!input_keyboard_line_event(g_keyboard_line, character))
return;
/* Line is complete, can free it now. */
input_keyboard_line_free(g_keyboard_line);