changeset 27380:843db879a6b2

Fixes unsafe 'angle' command with get_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:33:22 +0000
parents 89c03148e9a4
children 03f861e679a8
files command.c
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/command.c	Mon Aug 04 13:25:20 2008 +0000
+++ b/command.c	Mon Aug 04 13:33:22 2008 +0000
@@ -450,10 +450,11 @@
 static int mp_property_angle(m_option_t *prop, int action, void *arg,
                                MPContext *mpctx)
 {
-    int angle;
+    int angle = -1;
     int angles;
     char *angle_name = NULL;
 
+    if (mpctx->demuxer)
     angle = demuxer_get_current_angle(mpctx->demuxer);
     if (angle < 0)
         return M_PROPERTY_UNAVAILABLE;