[FFmpeg-cvslog] avcodec/mjpegdec: Fix DC overflow in decode_block()

Michael Niedermayer git at videolan.org
Wed Jul 15 05:16:36 CEST 2015


ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Wed Jul 15 04:59:35 2015 +0200| [dffae122d0f448029c30afc672233f114a3fe09c] | committer: Michael Niedermayer

avcodec/mjpegdec: Fix DC overflow in decode_block()

Fixes Ticket4683

Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=dffae122d0f448029c30afc672233f114a3fe09c
---

 libavcodec/mjpegdec.c |    1 +
 1 file changed, 1 insertion(+)

diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c
index f85eabf..8094274 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 */



More information about the ffmpeg-cvslog mailing list