Skip to content
Snippets Groups Projects
Commit 55d05286 authored by Michael Niedermayer's avatar Michael Niedermayer
Browse files

swr/dither: fix division by 0


Found-by: Daemon404
Signed-off-by: default avatarMichael Niedermayer <michaelni@gmx.at>
parent c13e4e28
No related branches found
No related tags found
No related merge requests found
...@@ -97,7 +97,7 @@ int swri_dither_init(SwrContext *s, enum AVSampleFormat out_fmt, enum AVSampleFo ...@@ -97,7 +97,7 @@ int swri_dither_init(SwrContext *s, enum AVSampleFormat out_fmt, enum AVSampleFo
s->dither.ns_pos = 0; s->dither.ns_pos = 0;
s->dither.noise_scale= scale; s->dither.noise_scale= scale;
s->dither.ns_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)); memset(s->dither.ns_errors, 0, sizeof(s->dither.ns_errors));
for (i=0; filters[i].coefs; i++) { for (i=0; filters[i].coefs; i++) {
const filter_t *f = &filters[i]; const filter_t *f = &filters[i];
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment