changeset 25771:f6c5b00976c6

Avoid a division by 0 if i_bps is 0.
author reimar
date Sat, 19 Jan 2008 14:38:24 +0000
parents 7013c4222a19
children cb331cd820d4
files libmpdemux/demux_audio.c
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/libmpdemux/demux_audio.c	Sat Jan 19 14:28:48 2008 +0000
+++ b/libmpdemux/demux_audio.c	Sat Jan 19 14:38:24 2008 +0000
@@ -691,7 +691,7 @@
 
 static int demux_audio_control(demuxer_t *demuxer,int cmd, void *arg){
     sh_audio_t *sh_audio=demuxer->audio->sh;
-    int audio_length = demuxer->movi_end / sh_audio->i_bps;
+    int audio_length = sh_audio->i_bps ? demuxer->movi_end / sh_audio->i_bps : 0;
     da_priv_t* priv = demuxer->priv;
 	    
     switch(cmd) {