changeset 13649:6a2bc6c93b7b

avoid segfault with -vc dummy
author reimar
date Fri, 15 Oct 2004 16:11:30 +0000
parents 0dd7df7510a5
children bb916781eec6
files libmpdemux/demux_mpg.c
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/libmpdemux/demux_mpg.c	Fri Oct 15 11:15:00 2004 +0000
+++ b/libmpdemux/demux_mpg.c	Fri Oct 15 16:11:30 2004 +0000
@@ -417,7 +417,7 @@
 
     switch(cmd) {
 	case DEMUXER_CTRL_GET_TIME_LENGTH:
-	    if(!sh_video->i_bps)  // unspecified or VBR 
+	    if(!sh_video || !sh_video->i_bps)  // unspecified or VBR 
     		return DEMUXER_CTRL_DONTKNOW;
 	    *((unsigned long *)arg)=(demuxer->movi_end-demuxer->movi_start)/sh_video->i_bps;
 	    return DEMUXER_CTRL_GUESS;