summaryrefslogtreecommitdiffstats
path: root/command.c
diff options
context:
space:
mode:
authorben <ben@b3059339-0415-0410-9bf9-f77b7e298cf2>2008-08-04 13:33:22 +0000
committerben <ben@b3059339-0415-0410-9bf9-f77b7e298cf2>2008-08-04 13:33:22 +0000
commit149cab0b0454462040f9f8aa57eb0ec85f3e16d6 (patch)
treec0e59758b5395e4e686e93c3b926ac246d37c3ec /command.c
parent291a150e81e631ae091b496b5c3a6771e9c6c28a (diff)
downloadmpv-149cab0b0454462040f9f8aa57eb0ec85f3e16d6.tar.bz2
mpv-149cab0b0454462040f9f8aa57eb0ec85f3e16d6.tar.xz
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) git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@27412 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'command.c')
-rw-r--r--command.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/command.c b/command.c
index 1f9bf1e4f5..2dedd97d14 100644
--- a/command.c
+++ b/command.c
@@ -450,10 +450,11 @@ static int mp_property_chapter(m_option_t *prop, int action, void *arg,
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;