(Threaded video) Fix null pointer dereferences

This commit is contained in:
Higor Eurípedes 2014-08-14 10:16:24 -03:00
parent 61eaead282
commit f53f155f2c
1 changed files with 11 additions and 6 deletions

View File

@ -267,9 +267,13 @@ static void thread_loop(void *data)
case CMD_SET_SHADER: case CMD_SET_SHADER:
{ {
bool ret = thr->driver->set_shader(thr->driver_data, bool ret = false;
thr->cmd_data.set_shader.type,
thr->cmd_data.set_shader.path); if (thr->driver->set_shader)
ret = thr->driver->set_shader(thr->driver_data,
thr->cmd_data.set_shader.type,
thr->cmd_data.set_shader.path);
thr->cmd_data.b = ret; thr->cmd_data.b = ret;
thread_reply(thr, CMD_SET_SHADER); thread_reply(thr, CMD_SET_SHADER);
break; break;
@ -324,9 +328,10 @@ static void thread_loop(void *data)
#endif #endif
case CMD_POKE_SET_FILTERING: case CMD_POKE_SET_FILTERING:
thr->poke->set_filtering(thr->driver_data, if (thr->poke->set_filtering)
thr->cmd_data.filtering.index, thr->poke->set_filtering(thr->driver_data,
thr->cmd_data.filtering.smooth); thr->cmd_data.filtering.index,
thr->cmd_data.filtering.smooth);
thread_reply(thr, CMD_POKE_SET_FILTERING); thread_reply(thr, CMD_POKE_SET_FILTERING);
break; break;