diff options
author | Michael Niedermayer <michael@niedermayer.cc> | 2015-11-15 22:05:04 +0100 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2015-11-15 22:11:05 +0100 |
commit | 0eb7de19736891a9386ab66549f780e904a3b6a7 (patch) | |
tree | 7005b8d9ba682290248544bc9ca590ec25ea6210 /libavcodec/jpeg2000.c | |
parent | 65d3359fb366ea265a8468d76a111cb7352f0b55 (diff) | |
download | ffmpeg-0eb7de19736891a9386ab66549f780e904a3b6a7.tar.gz |
avcodec/jpeg2000: Change coord to 32bit to support larger than 32k width or height
Fixes: 03e0abe721b1174856d41a1eb5d6a896/signal_sigabrt_7ffff6ae7cc9_3813_e71bf3541abed3ccba031cd5ba0269a4.avi
Found-by: Mateusz "j00ru" Jurczyk and Gynvael Coldwind
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavcodec/jpeg2000.c')
-rw-r--r-- | libavcodec/jpeg2000.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/libavcodec/jpeg2000.c b/libavcodec/jpeg2000.c index 7cf337bf10..cbca18e2ca 100644 --- a/libavcodec/jpeg2000.c +++ b/libavcodec/jpeg2000.c @@ -322,7 +322,7 @@ static int init_prec(Jpeg2000Band *band, return AVERROR(ENOMEM); for (cblkno = 0; cblkno < nb_codeblocks; cblkno++) { Jpeg2000Cblk *cblk = prec->cblk + cblkno; - uint16_t Cx0, Cy0; + int Cx0, Cy0; /* Compute coordinates of codeblocks */ /* Compute Cx0*/ @@ -468,8 +468,8 @@ int ff_jpeg2000_init_component(Jpeg2000Component *comp, return AVERROR_INVALIDDATA; csize = (comp->coord[0][1] - comp->coord[0][0]) * (comp->coord[1][1] - comp->coord[1][0]); - if (comp->coord[0][1] > 32768 || - comp->coord[1][1] > 32768) { + if (comp->coord[0][1] - comp->coord[0][0] > 32768 || + comp->coord[1][1] - comp->coord[1][0] > 32768) { av_log(avctx, AV_LOG_ERROR, "component size too large\n"); return AVERROR_PATCHWELCOME; } |