Commit dffae122 authored by Michael Niedermayer's avatar Michael Niedermayer

avcodec/mjpegdec: Fix DC overflow in decode_block()

Fixes Ticket4683
Signed-off-by: 's avatarMichael Niedermayer <michael@niedermayer.cc>
parent 90dd6ad2
......@@ -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 */
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment