summaryrefslogtreecommitdiffstats
path: root/command.c
diff options
context:
space:
mode:
authorben <ben@b3059339-0415-0410-9bf9-f77b7e298cf2>2008-08-04 13:25:20 +0000
committerben <ben@b3059339-0415-0410-9bf9-f77b7e298cf2>2008-08-04 13:25:20 +0000
commit291a150e81e631ae091b496b5c3a6771e9c6c28a (patch)
tree0b68981d0ed1c3e40a0de086d7e68b75d831dc98 /command.c
parent127339a624f85f1ad35effbb932205079b94aa37 (diff)
downloadmpv-291a150e81e631ae091b496b5c3a6771e9c6c28a.tar.bz2
mpv-291a150e81e631ae091b496b5c3a6771e9c6c28a.tar.xz
Fixes unsafe 'switch_audio' command with set_property() call.
Without it, MPlayer segv trying to dereference NULL demuxer. Patch by Mathieu Schroeter (mathieu dot schroeter at gamesover dot ch) git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27411 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'command.c')
-rw-r--r--command.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/command.c b/command.c
index b18080b6a4..1f9bf1e4f5 100644
--- a/command.c
+++ b/command.c
@@ -835,6 +835,8 @@ static int mp_property_audio(m_option_t * prop, int action, void *arg,
case M_PROPERTY_STEP_UP:
case M_PROPERTY_SET:
+ if (!mpctx->demuxer)
+ return M_PROPERTY_UNAVAILABLE;
if (action == M_PROPERTY_SET && arg)
tmp = *((int *) arg);
else