From a7a82090c4bac3572f3963a000c1215bdc7d5ab9 Mon Sep 17 00:00:00 2001 From: Julien Malik Date: Mon, 2 May 2016 16:21:43 +0200 Subject: [PATCH] Fix #612 --- src/lib/openjp2/t1.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/openjp2/t1.c b/src/lib/openjp2/t1.c index 1bf7205e..4dd2c60e 100644 --- a/src/lib/openjp2/t1.c +++ b/src/lib/openjp2/t1.c @@ -1662,7 +1662,7 @@ static void opj_t1_encode_cblk(opj_t1_t *t1, bpno--; } - if (pass->term && bpno > 0) { + if (pass->term) { type = ((bpno < ((OPJ_INT32) (cblk->numbps) - 4)) && (passtype < 2) && (cblksty & J2K_CCP_CBLKSTY_LAZY)) ? T1_TYPE_RAW : T1_TYPE_MQ; if (type == T1_TYPE_RAW) opj_mqc_bypass_init_enc(mqc);