# HG changeset patch # User reimar # Date 1136727354 0 # Node ID adb64d908347a7f4566b8a9cad3a7a71b781bb3b # Parent c919e346b0d1fc1db9fb4b3a1614abf0cec99fce fix crash if no video codec available diff -r c919e346b0d1 -r adb64d908347 libmpdemux/demux_avi.c --- a/libmpdemux/demux_avi.c Sun Jan 08 10:18:18 2006 +0000 +++ b/libmpdemux/demux_avi.c Sun Jan 08 13:35:54 2006 +0000 @@ -837,13 +837,13 @@ 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);