From bde5ba6ae831424695e8b677a5e554e0b0275c20 Mon Sep 17 00:00:00 2001 From: Matthieu Darbois Date: Mon, 22 Dec 2014 15:00:12 +0000 Subject: [PATCH] [trunk] fixed compression check for 1 bit unsigned component (fixes issue 457) --- src/lib/openjp2/jp2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/openjp2/jp2.c b/src/lib/openjp2/jp2.c index 3ee07af3..6d7a24e1 100644 --- a/src/lib/openjp2/jp2.c +++ b/src/lib/openjp2/jp2.c @@ -1969,7 +1969,7 @@ OPJ_BOOL opj_jp2_default_validation ( opj_jp2_t * jp2, l_is_valid &= (jp2->w > 0); /* precision */ for (i = 0; i < jp2->numcomps; ++i) { - l_is_valid &= (jp2->comps[i].bpcc > 0); + l_is_valid &= ((jp2->comps[i].bpcc & 0x7FU) < 38U); /* 0 is valid, ignore sign for check */ } /* METH */