# HG changeset patch # User reimar # Date 1261922540 0 # Node ID fb239b3fd07578430671afdf35f4b8ab7af639be # Parent 72e4567e7a0ab4f3abad1b55a45ebe5def59af92 When setting audio or video track make sure we will not try to dereference a NULL pointer, e.g. because there is no video stream. diff -r 72e4567e7a0a -r fb239b3fd075 command.c --- a/command.c Sun Dec 27 13:56:51 2009 +0000 +++ b/command.c Sun Dec 27 14:02:20 2009 +0000 @@ -840,7 +840,7 @@ case M_PROPERTY_STEP_UP: case M_PROPERTY_SET: - if (!mpctx->demuxer) + if (!mpctx->demuxer || !mpctx->demuxer->audio) return M_PROPERTY_UNAVAILABLE; if (action == M_PROPERTY_SET && arg) tmp = *((int *) arg); @@ -900,11 +900,13 @@ case M_PROPERTY_STEP_UP: case M_PROPERTY_SET: - current_id = mpctx->demuxer->video->id; + if (!mpctx->demuxer || !mpctx->demuxer->video) + return M_PROPERTY_UNAVAILABLE; if (action == M_PROPERTY_SET && arg) tmp = *((int *) arg); else tmp = -1; + current_id = mpctx->demuxer->video->id; video_id = demuxer_switch_video(mpctx->demuxer, tmp); if (video_id == -2 || (video_id > -1 && mpctx->demuxer->video->id != current_id