All pastes #590779 Raw Edit

Something

public text v1 · immutable
#590779 ·published 2007-06-26 19:39 UTC
rendered paste body
diff --git a/libavformat/avisynth.c b/libavformat/avisynth.c
index 1afcdea..34b12ee 100644
--- a/libavformat/avisynth.c
+++ b/libavformat/avisynth.c
@@ -93,7 +93,11 @@ static int avisynth_read_header(AVFormatContext *s, AVFormatParameters *ap)
                   st->codec->bit_rate = wvfmt.nAvgBytesPerSec * 8;
                   st->codec->bits_per_sample = wvfmt.wBitsPerSample;
 
-                  stream->chunck_samples = wvfmt.nSamplesPerSec * (uint64_t)info.dwScale / (uint64_t)info.dwRate;
+                  if (info.dwScale && info.dwRate)
+                      stream->chunck_samples = wvfmt.nSamplesPerSec * (uint64_t)info.dwScale / (uint64_t)info.dwRate;
+                  else
+                      stream->chunck_samples = 1152;
+
                   stream->chunck_size = stream->chunck_samples * wvfmt.nChannels * wvfmt.wBitsPerSample / 8;
 
                   st->codec->codec_tag = wvfmt.wFormatTag;