diff mbox series

[FFmpeg-devel,1/2] avcodec/dpcm: Fix integer overflow in AV_CODEC_ID_GREMLIN_DPCM

Message ID 20200122233639.28302-1-michael@niedermayer.cc
State Accepted
Headers show
Series [FFmpeg-devel,1/2] avcodec/dpcm: Fix integer overflow in AV_CODEC_ID_GREMLIN_DPCM | expand

Checks

Context Check Description
andriy/ffmpeg-patchwork success Make fate finished

Commit Message

Michael Niedermayer Jan. 22, 2020, 11:36 p.m. UTC
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>
---
 libavcodec/dpcm.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Michael Niedermayer Feb. 9, 2020, 8:33 p.m. UTC | #1
On Thu, Jan 23, 2020 at 12:36:38AM +0100, Michael Niedermayer wrote:
> 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>
> ---
>  libavcodec/dpcm.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)

will apply

[...]
diff mbox series

Patch

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;
         }
         }