diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2015-07-15 04:59:35 +0200 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2015-07-15 05:05:25 +0200 |
commit | dffae122d0f448029c30afc672233f114a3fe09c (patch) | |
tree | 46e01675ecba864cb835278479d77afd14138d52 | |
parent | 90dd6ad22cee78ef8d8de27e30839f99e69a7909 (diff) | |
download | ffmpeg-dffae122d0f448029c30afc672233f114a3fe09c.tar.gz |
avcodec/mjpegdec: Fix DC overflow in decode_block()
Fixes Ticket4683
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
-rw-r--r-- | libavcodec/mjpegdec.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c index f85eabfe4d..8094274ff6 100644 --- a/libavcodec/mjpegdec.c +++ b/libavcodec/mjpegdec.c @@ -672,6 +672,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); s->last_dc[component] = val; block[0] = val; /* AC coefs */ |