aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Niedermayer <michael@niedermayer.cc>2015-07-15 04:59:35 +0200
committerMichael Niedermayer <michael@niedermayer.cc>2015-07-15 05:05:25 +0200
commitdffae122d0f448029c30afc672233f114a3fe09c (patch)
tree46e01675ecba864cb835278479d77afd14138d52
parent90dd6ad22cee78ef8d8de27e30839f99e69a7909 (diff)
downloadffmpeg-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.c1
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 */