changeset 27379:89c03148e9a4

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)
author ben
date Mon, 04 Aug 2008 13:25:20 +0000
parents ea586e46da1c
children 843db879a6b2
files command.c
diffstat 1 files changed, 2 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/command.c	Mon Aug 04 09:23:29 2008 +0000
+++ b/command.c	Mon Aug 04 13:25:20 2008 +0000
@@ -835,6 +835,8 @@
 
     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