[FFmpeg-cvslog] avcodec/mjpegdec: Check quant_matrixes values for being non zero

Michael Niedermayer git at videolan.org
Mon Mar 20 03:39:50 EET 2017


ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Fri Mar 17 03:25:17 2017 +0100| [656a17e126c08ac8ed71da99047f13cf3e6c2a7c] | committer: Michael Niedermayer

avcodec/mjpegdec: Check quant_matrixes values for being non zero

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

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

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

diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c
index 8bf2fdf..af12d5d 100644
--- a/libavcodec/mjpegdec.c
+++ b/libavcodec/mjpegdec.c
@@ -188,6 +188,10 @@ int ff_mjpeg_decode_dqt(MJpegDecodeContext *s)
         /* read quant table */
         for (i = 0; i < 64; i++) {
             s->quant_matrixes[index][i] = get_bits(&s->gb, pr ? 16 : 8);
+            if (s->quant_matrixes[index][i] == 0) {
+                av_log(s->avctx, AV_LOG_ERROR, "dqt: 0 quant value\n");
+                return AVERROR_INVALIDDATA;
+            }
         }
 
         // XXX FIXME fine-tune, and perhaps add dc too



More information about the ffmpeg-cvslog mailing list