1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

avcodec/mjpegdec: Fix DC overflow in decode_block()

Fixes Ticket4683

Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Michael Niedermayer 2015-07-15 04:59:35 +02:00
parent 90dd6ad22c
commit dffae122d0

View File

@ -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 */