From 3b31501ff75798db5cf841f62e9cac535af9eceb Mon Sep 17 00:00:00 2001 From: reimar Date: Sun, 8 Jan 2006 13:35:54 +0000 Subject: fix crash if no video codec available git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@17343 b3059339-0415-0410-9bf9-f77b7e298cf2 --- libmpdemux/demux_avi.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'libmpdemux') diff --git a/libmpdemux/demux_avi.c b/libmpdemux/demux_avi.c index 5dfaf413c4..0a6a23df08 100644 --- a/libmpdemux/demux_avi.c +++ b/libmpdemux/demux_avi.c @@ -837,13 +837,13 @@ static int demux_avi_control(demuxer_t *demuxer,int cmd, void *arg){ switch(cmd) { case DEMUXER_CTRL_GET_TIME_LENGTH: - if (!priv->numberofframes) return DEMUXER_CTRL_DONTKNOW; + if (!priv->numberofframes || !sh_video) return DEMUXER_CTRL_DONTKNOW; *((double *)arg)=(double)priv->numberofframes/sh_video->fps; if (sh_video->video.dwLength<=1) return DEMUXER_CTRL_GUESS; return DEMUXER_CTRL_OK; case DEMUXER_CTRL_GET_PERCENT_POS: - if (!priv->numberofframes) { + if (!priv->numberofframes || !sh_video) { return DEMUXER_CTRL_DONTKNOW; } *((int *)arg)=(int)(priv->video_pack_no*100/priv->numberofframes); -- cgit v1.2.3