aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2019-11-25 21:50:57 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2020-07-01 12:49:26 +0200
commit263afaf541b6854cb5385041a4e232eff410a617 (patch)
tree267bac67db4ed601a3727a28df6fdb5f7b2cedbc
parentb20f2bec1baa2b5c4268b9910fc4d9f9d2f87df8 (diff)
downloadffmpeg-263afaf541b6854cb5385041a4e232eff410a617.tar.gz
avcodec/ffwavesynth: Fix undefined overflow in wavesynth_synth_sample()
Fixes: signed integer overflow: 2147464192 + 21176 cannot be represented in type 'int' Fixes: 19042/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_FFWAVESYNTH_fuzzer-5719828090585088 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 fa47f6412dbf93b4865adf8c66618906a3274330) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/ffwavesynth.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libavcodec/ffwavesynth.c b/libavcodec/ffwavesynth.c
index 349b45534d..b9c63abb8d 100644
--- a/libavcodec/ffwavesynth.c
+++ b/libavcodec/ffwavesynth.c
@@ -350,7 +350,8 @@ fail:
static void wavesynth_synth_sample(struct wavesynth_context *ws, int64_t ts,
int32_t *channels)
{
- int32_t amp, val, *cv;
+ int32_t amp, *cv;
+ unsigned val;
struct ws_interval *in;
int i, *last, pink;
uint32_t c, all_ch = 0;