# HG changeset patch # User ben # Date 1217856914 0 # Node ID aff29422c652521a5872896224d4a9113d16a447 # Parent 03f861e679a8ee17a5f3c892893c91e193ad0708 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) diff -r 03f861e679a8 -r aff29422c652 command.c --- a/command.c Mon Aug 04 13:34:10 2008 +0000 +++ b/command.c Mon Aug 04 13:35:14 2008 +0000 @@ -379,12 +379,13 @@ 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;