aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2019-09-30 00:35:15 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2019-11-15 12:25:46 +0100
commit8d7d6066efc84d88893ca5590a844627eecedd2c (patch)
treec7c403a488217c4b2771e7552f263b8f510ae44b
parent0dc659b8fbe5a7af4a25123481a855b75291f1de (diff)
downloadffmpeg-8d7d6066efc84d88893ca5590a844627eecedd2c.tar.gz
avcodec/ffwavesynth: Fix integer overflows in pink noise addition
Fixes: signed integer overflow: -1795675744 + -1926578528 cannot be represented in type 'int' Fixes: 17741/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_FFWAVESYNTH_fuzzer-5131336402075648 Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg Signed-off-by: Michael Niedermayer <michael@niedermayer.cc> (cherry picked from commit 7916b6863caec55d7e64758a1bfe436834f2faf6) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/ffwavesynth.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/libavcodec/ffwavesynth.c b/libavcodec/ffwavesynth.c
index 6736587e32..3a6a057964 100644
--- a/libavcodec/ffwavesynth.c
+++ b/libavcodec/ffwavesynth.c
@@ -377,7 +377,7 @@ static void wavesynth_synth_sample(struct wavesynth_context *ws, int64_t ts,
in->dphi += in->ddphi;
break;
case WS_NOISE:
- val = amp * pink;
+ val = amp * (unsigned)pink;
break;
default:
val = 0;
@@ -385,7 +385,7 @@ static void wavesynth_synth_sample(struct wavesynth_context *ws, int64_t ts,
all_ch |= in->channels;
for (c = in->channels, cv = channels; c; c >>= 1, cv++)
if (c & 1)
- *cv += val;
+ *cv += (unsigned)val;
}
val = (int32_t)lcg_next(&ws->dither_state) >> 16;
for (c = all_ch, cv = channels; c; c >>= 1, cv++)