aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2020-01-22 23:11:47 +0100
committerMichael Niedermayer <michael@niedermayer.cc>2020-07-02 19:55:09 +0200
commite4921f409d839a07c90d232ea0629779ee064e1f (patch)
treef54f7d99baf0ffa17d0da194e5d89d4e13ef2e03
parentd60daf43bc7dced5088434a7209a7135830bc811 (diff)
downloadffmpeg-e4921f409d839a07c90d232ea0629779ee064e1f.tar.gz
avcodec/dpcm: Fix integer overflow in AV_CODEC_ID_GREMLIN_DPCM
Fixes: signed integer overflow: -2147479324 + -32568 cannot be represented in type 'int' Fixes: 20103/clusterfuzz-testcase-minimized-ffmpeg_AV_CODEC_ID_GREMLIN_DPCM_fuzzer-5667667579240448 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 b1aecad9eae900b9c3054392994d150d5ae572c5) Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r--libavcodec/dpcm.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libavcodec/dpcm.c b/libavcodec/dpcm.c
index 7d3934ee35..5958081b66 100644
--- a/libavcodec/dpcm.c
+++ b/libavcodec/dpcm.c
@@ -367,7 +367,7 @@ static int dpcm_decode_frame(AVCodecContext *avctx, void *data,
while (output_samples < samples_end) {
uint8_t n = bytestream2_get_byteu(&gb);
- *output_samples++ = s->sample[idx] += s->array[n];
+ *output_samples++ = s->sample[idx] += (unsigned)s->array[n];
idx ^= 1;
}
}