[FFmpeg-cvslog] avcodec/jpeg2000dec: Add some additional checking on lengthinc

Michael Niedermayer git at videolan.org
Fri Jun 12 02:44:52 CEST 2015


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Fri Jun 12 01:13:55 2015 +0200| [5ccca4eb8e1eafaa3c7bc97aec7b7131c10b3ce9] | committer: Michael Niedermayer

avcodec/jpeg2000dec: Add some additional checking on lengthinc

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

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

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

diff --git a/libavcodec/jpeg2000dec.c b/libavcodec/jpeg2000dec.c
index 6f4bd19..aa6d8ec 100644
--- a/libavcodec/jpeg2000dec.c
+++ b/libavcodec/jpeg2000dec.c
@@ -807,6 +807,12 @@ static int jpeg2000_decode_packet(Jpeg2000DecoderContext *s,
                 return newpasses;
             if ((llen = getlblockinc(s)) < 0)
                 return llen;
+            if (cblk->lblock + llen + av_log2(newpasses) > 16) {
+                avpriv_request_sample(s->avctx,
+                                      "Block with length beyond 16 bits\n");
+                return AVERROR_PATCHWELCOME;
+            }
+
             cblk->lblock += llen;
             if ((ret = get_bits(s, av_log2(newpasses) + cblk->lblock)) < 0)
                 return ret;



More information about the ffmpeg-cvslog mailing list