[FFmpeg-cvslog] jpeg2000dec: Check bpno in decode_cblk()

Michael Niedermayer git at videolan.org
Mon Jun 10 17:41:25 CEST 2013


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Sun Jun  9 00:36:04 2013 +0200| [8e887ca1fe6ccc5f2a64850e109b27772f006761] | committer: Michael Niedermayer

jpeg2000dec: Check bpno in decode_cblk()

Fixes integer overflow in fate-redcode-demux

Reviewed-by: Nicolas BERTRAND <nicoinattendu at gmail.com>
Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

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

diff --git a/libavcodec/jpeg2000dec.c b/libavcodec/jpeg2000dec.c
index af542b9..da510c6 100644
--- a/libavcodec/jpeg2000dec.c
+++ b/libavcodec/jpeg2000dec.c
@@ -901,6 +901,10 @@ static int decode_cblk(Jpeg2000DecoderContext *s, Jpeg2000CodingStyle *codsty,
     ff_mqc_initdec(&t1->mqc, cblk->data);
 
     while (passno--) {
+        if (bpno < 0) {
+            av_log(s->avctx, AV_LOG_ERROR, "bpno invalid\n");
+            return AVERROR(EINVAL);
+        }
         switch(pass_t) {
         case 0:
             decode_sigpass(t1, width, height, bpno + 1, bandpos,



More information about the ffmpeg-cvslog mailing list