Commit bbf43c70 authored by Michael Niedermayer's avatar Michael Niedermayer

jpeg2000dec: assert that curtileno is valid when used

Fixes CID1026755
Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 234f76ae
...@@ -25,6 +25,7 @@ ...@@ -25,6 +25,7 @@
* JPEG 2000 image decoder * JPEG 2000 image decoder
*/ */
#include "libavutil/avassert.h"
#include "libavutil/common.h" #include "libavutil/common.h"
#include "libavutil/opt.h" #include "libavutil/opt.h"
#include "avcodec.h" #include "avcodec.h"
...@@ -1230,6 +1231,7 @@ static int jpeg2000_read_main_headers(Jpeg2000DecoderContext *s) ...@@ -1230,6 +1231,7 @@ static int jpeg2000_read_main_headers(Jpeg2000DecoderContext *s)
break; break;
case JPEG2000_SOT: case JPEG2000_SOT:
if (!(ret = get_sot(s, len))) { if (!(ret = get_sot(s, len))) {
av_assert1(s->curtileno >= 0);
codsty = s->tile[s->curtileno].codsty; codsty = s->tile[s->curtileno].codsty;
qntsty = s->tile[s->curtileno].qntsty; qntsty = s->tile[s->curtileno].qntsty;
properties = s->tile[s->curtileno].properties; properties = s->tile[s->curtileno].properties;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment