Author: ben Date: Mon Aug 4 15:35:14 2008 New Revision: 27414 Log: 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) Modified: trunk/command.c Modified: trunk/command.c ============================================================================== --- trunk/command.c (original) +++ trunk/command.c Mon Aug 4 15:35:14 2008 @@ -379,12 +379,13 @@ static int mp_property_time_pos(m_option 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;
On Monday 04 August 2008 15:35:15 ben wrote:
Author: ben Date: Mon Aug 4 15:35:14 2008 New Revision: 27414
Log: 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)
Modified: trunk/command.c
Modified: trunk/command.c =================================================================== =========== --- trunk/command.c (original) +++ trunk/command.c Mon Aug 4 15:35:14 2008 @@ -379,12 +379,13 @@ static int mp_property_time_pos(m_option 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;
sorry if I'm late (the heat is making me melt) , but how on earth is it possible that mplayer is running with mpctx->demuxer == NULL ? Most likely this is a workaround hiding the real bug
Nico Sabbi wrote:
sorry if I'm late (the heat is making me melt) , but how on earth is it possible that mplayer is running with mpctx->demuxer == NULL ? Most likely this is a workaround hiding the real bug
As Mathieu says in his patch, just start MPlayer this way: mplayer -idle -slave It won't decode anything (so no demuxer) but will wait user to feed him with 'loadfile' command. Of course, nothing prevents user sending other commands first (which won't do anything obviously but shouldn't segv the player). Ben
On Monday 04 August 2008 15:44:38 Benjamin Zores wrote:
Nico Sabbi wrote:
sorry if I'm late (the heat is making me melt) , but how on earth is it possible that mplayer is running with mpctx->demuxer == NULL ? Most likely this is a workaround hiding the real bug
As Mathieu says in his patch, just start MPlayer this way:
mplayer -idle -slave
It won't decode anything (so no demuxer) but will wait user to feed him with 'loadfile' command. Of course, nothing prevents user sending other commands first (which won't do anything obviously but shouldn't segv the player).
Ben
I see, thanks for explaining
participants (3)
-
ben -
Benjamin Zores -
Nico Sabbi