summaryrefslogtreecommitdiffstats
path: root/command.c
diff options
context:
space:
mode:
authorben <ben@b3059339-0415-0410-9bf9-f77b7e298cf2>2008-08-04 13:35:14 +0000
committerben <ben@b3059339-0415-0410-9bf9-f77b7e298cf2>2008-08-04 13:35:14 +0000
commit450935badc256cc6c2307fd47cdb9c75fa294798 (patch)
treef043b8fa476c5e14114fbd6ec21960b4a480d979 /command.c
parent8f484452164c8efc532dc36f9d6f548cd5234045 (diff)
downloadmpv-450935badc256cc6c2307fd47cdb9c75fa294798.tar.bz2
mpv-450935badc256cc6c2307fd47cdb9c75fa294798.tar.xz
Fixes unsafe 'chapter' 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@27414 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 31201b6fef..9b5fa9af40 100644
--- a/command.c
+++ b/command.c
@@ -379,12 +379,13 @@ static int mp_property_time_pos(m_option_t * prop, int action,
static int mp_property_chapter(m_option_t *prop, int action, void *arg,
MPContext *mpctx)
{
- int chapter;
+ int chapter = -1;
float next_pts = 0;
int chapter_num;
int step_all;
char *chapter_name = NULL;
+ if (mpctx->demuxer)
chapter = demuxer_get_current_chapter(mpctx->demuxer);
if (chapter < 0)
return M_PROPERTY_UNAVAILABLE;