summaryrefslogtreecommitdiff
authorMichael Niedermayer <michaelni@gmx.at>2013-01-14 00:06:48 (GMT)
committer Michael Niedermayer <michaelni@gmx.at>2013-01-14 01:57:00 (GMT)
commit55d05286696473487ce51e347985378e28c0713b (patch)
tree20a69f97351f8e2f78c54b4fa0adcbc360090ce5
parentc13e4e288c84ba0629ead15e1460c0e498ee2bce (diff)
downloadffmpeg-55d05286696473487ce51e347985378e28c0713b.zip
ffmpeg-55d05286696473487ce51e347985378e28c0713b.tar.gz
ffmpeg-55d05286696473487ce51e347985378e28c0713b.tar.bz2
swr/dither: fix division by 0
Found-by: Daemon404 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat
-rw-r--r--libswresample/dither.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libswresample/dither.c b/libswresample/dither.c
index ae56c8c..d70505c 100644
--- a/libswresample/dither.c
+++ b/libswresample/dither.c
@@ -97,7 +97,7 @@ int swri_dither_init(SwrContext *s, enum AVSampleFormat out_fmt, enum AVSampleFo
s->dither.ns_pos = 0;
s->dither.noise_scale= scale;
s->dither.ns_scale = scale;
- s->dither.ns_scale_1 = 1/scale;
+ s->dither.ns_scale_1 = scale ? 1/scale : 0;
memset(s->dither.ns_errors, 0, sizeof(s->dither.ns_errors));
for (i=0; filters[i].coefs; i++) {
const filter_t *f = &filters[i];