aboutsummaryrefslogtreecommitdiffhomepage
path: root/libmpdemux
diff options
context:
space:
mode:
authorGravatar reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2006-01-08 13:35:54 +0000
committerGravatar reimar <reimar@b3059339-0415-0410-9bf9-f77b7e298cf2>2006-01-08 13:35:54 +0000
commit3b31501ff75798db5cf841f62e9cac535af9eceb (patch)
treeb7949446a2c0c5369e6979cffceeae392c2b117e /libmpdemux
parent757387a4fca42258b9b75db68123558fd891eeed (diff)
fix crash if no video codec available
git-svn-id: svn://svn.mplayerhq.hu/mplayer/trunk@17343 b3059339-0415-0410-9bf9-f77b7e298cf2
Diffstat (limited to 'libmpdemux')
-rw-r--r--libmpdemux/demux_avi.c4
1 files changed, 2 insertions, 2 deletions
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);