[FFmpeg-cvslog] mjpegdec: print error message when quant_index is invalid

Michael Niedermayer git at videolan.org
Fri Nov 30 04:19:27 CET 2012


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Fri Nov 30 04:00:05 2012 +0100| [bc16031a410e0a77927f0604560aa9c803df26b2] | committer: Michael Niedermayer

mjpegdec: print error message when quant_index is invalid

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

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

diff --git a/libavcodec/mjpegdec.c b/libavcodec/mjpegdec.c
index 04debbf..c47093b 100644
--- a/libavcodec/mjpegdec.c
+++ b/libavcodec/mjpegdec.c
@@ -283,8 +283,10 @@ int ff_mjpeg_decode_sof(MJpegDecodeContext *s)
             return -1;
         }
         s->quant_index[i] = get_bits(&s->gb, 8);
-        if (s->quant_index[i] >= 4)
+        if (s->quant_index[i] >= 4) {
+            av_log(s->avctx, AV_LOG_ERROR, "quant_index is invalid\n");
             return AVERROR_INVALIDDATA;
+        }
         av_log(s->avctx, AV_LOG_DEBUG, "component %d %d:%d id: %d quant:%d\n",
                i, h_count[i], v_count[i],
                s->component_id[i], s->quant_index[i]);



More information about the ffmpeg-cvslog mailing list