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:
parent
90dd6ad22c
commit
dffae122d0
@ -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 */
|
||||
|
Loading…
Reference in New Issue
Block a user