command: fix null pointer dereference in idle mode

Pressing 'h' in idle mode -> crash.
This commit is contained in:
wm4
2014-03-02 22:39:20 +01:00
parent 8f2ee917d4
commit 4bc0e3feac
+2 -2
View File
@@ -3160,7 +3160,7 @@ void run_command(MPContext *mpctx, mp_cmd_t *cmd)
}
#endif /* HAVE_PVR */
#if HAVE_DVBIN
if (mpctx->stream->type == STREAMTYPE_DVB) {
if (mpctx->stream && mpctx->stream->type == STREAMTYPE_DVB) {
int dir;
int v = cmd->args[0].v.i;
@@ -3198,7 +3198,7 @@ void run_command(MPContext *mpctx, mp_cmd_t *cmd)
#if HAVE_DVBIN
case MP_CMD_DVB_SET_CHANNEL:
if (mpctx->stream->type == STREAMTYPE_DVB) {
if (mpctx->stream && mpctx->stream->type == STREAMTYPE_DVB) {
mpctx->last_dvb_step = 1;
if (dvb_set_channel(mpctx->stream, cmd->args[1].v.i,