diff options
-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 */ |