[FFmpeg-cvslog] avcodec/mjpegdec: Clip DC also on the negative side.
Michael Niedermayer
git at videolan.org
Wed Jul 19 17:58:46 EEST 2017
ffmpeg | branch: release/3.3 | Michael Niedermayer <michael at niedermayer.cc> | Wed Jul 12 16:24:18 2017 +0200| [dbb121688cecabf2210f598b17a1567506d5c634] | committer: Michael Niedermayer
avcodec/mjpegdec: Clip DC also on the negative side.
Fixes: runtime error: signed integer overflow: -16711425 + -2130772346 cannot be represented in type 'int'
Fixes: 2533/clusterfuzz-testcase-minimized-5372857678823424
Found-by: continuous fuzzing process https://github.com/google/oss-fuzz/tree/master/projects/ffmpeg
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
(cherry picked from commit c28f648b19dd36ff9bc869ad527a1569a0b623e2)
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=dbb121688cecabf2210f598b17a1567506d5c634
---
libavcodec/mjpegdec.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c
index 6cc9473309..bd6dd7ef47 100644
--- a/libavcodec/mjpegdec.c
+++ b/libavcodec/mjpegdec.c
@@ -697,7 +697,7 @@ static int decode_block(MJpegDecodeContext *s, int16_t *block, int component,
return AVERROR_INVALIDDATA;
}
val = val * quant_matrix[0] + s->last_dc[component];
- val = FFMIN(val, 32767);
+ val = av_clip_int16(val);
s->last_dc[component] = val;
block[0] = val;
/* AC coefs */
More information about the ffmpeg-cvslog
mailing list