Merge pull request #878 from heuripedes/master

(Threaded video) Fix null pointer dereferences
This commit is contained in:
Twinaphex 2014-08-14 15:36:35 +02:00
commit ea178216cc

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;