summaryrefslogtreecommitdiff
path: root/libavcodec/jpeg2000.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2015-06-14 21:05:38 +0200
committerMichael Niedermayer <michaelni@gmx.at>2015-06-14 22:59:50 +0200
commitec5164aa310ebcdb5ddb513d56cb72b847a84cda (patch)
tree7b4f7206591cbc19c6e1387074c6e5ba7c83d319 /libavcodec/jpeg2000.c
parenta206c13289e6153c910ecb47eba5fc9e1d8fbbc7 (diff)
avcodec/jpeg2000: Fix regression with multiple tiles
Fixes Ticket 4624 Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavcodec/jpeg2000.c')
-rw-r--r--libavcodec/jpeg2000.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/libavcodec/jpeg2000.c b/libavcodec/jpeg2000.c
index d2dbffa858..427f6f7423 100644
--- a/libavcodec/jpeg2000.c
+++ b/libavcodec/jpeg2000.c
@@ -402,13 +402,14 @@ int ff_jpeg2000_init_component(Jpeg2000Component *comp,
prec->coord[1][1] = FFMIN(prec->coord[1][1], band->coord[1][1]);
prec->nb_codeblocks_width =
- ff_jpeg2000_ceildivpow2(prec->coord[0][1] -
- prec->coord[0][0],
- band->log2_cblk_width);
+ ff_jpeg2000_ceildivpow2(prec->coord[0][1],
+ band->log2_cblk_width)
+ - (prec->coord[0][0] >> band->log2_cblk_width);
prec->nb_codeblocks_height =
- ff_jpeg2000_ceildivpow2(prec->coord[1][1] -
- prec->coord[1][0],
- band->log2_cblk_height);
+ ff_jpeg2000_ceildivpow2(prec->coord[1][1],
+ band->log2_cblk_height)
+ - (prec->coord[1][0] >> band->log2_cblk_height);
+
/* Tag trees initialization */
prec->cblkincl =