[FFmpeg-cvslog] jpeg2000dec: assert that curtileno is valid when used

Michael Niedermayer git at videolan.org
Mon Jun 3 15:00:26 CEST 2013


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Mon Jun  3 14:37:16 2013 +0200| [bbf43c70dd43482a94aef3ebcb767830069bd1c0] | committer: Michael Niedermayer

jpeg2000dec: assert that curtileno is valid when used

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

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

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

diff --git a/libavcodec/jpeg2000dec.c b/libavcodec/jpeg2000dec.c
index 5c8db96..c7519c1 100644
--- a/libavcodec/jpeg2000dec.c
+++ b/libavcodec/jpeg2000dec.c
@@ -25,6 +25,7 @@
  * JPEG 2000 image decoder
  */
 
+#include "libavutil/avassert.h"
 #include "libavutil/common.h"
 #include "libavutil/opt.h"
 #include "avcodec.h"
@@ -1230,6 +1231,7 @@ static int jpeg2000_read_main_headers(Jpeg2000DecoderContext *s)
             break;
         case JPEG2000_SOT:
             if (!(ret = get_sot(s, len))) {
+                av_assert1(s->curtileno >= 0);
                 codsty = s->tile[s->curtileno].codsty;
                 qntsty = s->tile[s->curtileno].qntsty;
                 properties = s->tile[s->curtileno].properties;



More information about the ffmpeg-cvslog mailing list