changeset 25772:cb331cd820d4

Fix endless loop if nAvgBytesPerSec is 0.
author reimar
date Sat, 19 Jan 2008 14:43:58 +0000
parents f6c5b00976c6
children dfeedb0580f0
files libmpdemux/demux_audio.c
diffstat 1 files changed, 1 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/libmpdemux/demux_audio.c	Sat Jan 19 14:38:24 2008 +0000
+++ b/libmpdemux/demux_audio.c	Sat Jan 19 14:43:58 2008 +0000
@@ -582,6 +582,7 @@
   case WAV : {
     unsigned align = sh_audio->wf->nBlockAlign;
     l = sh_audio->wf->nAvgBytesPerSec;
+    if (l <= 0) l = 65536;
     if (demux->movi_end && l > demux->movi_end - stream_tell(s)) {
       // do not read beyond end, there might be junk after data chunk
       l = demux->movi_end - stream_tell(s);