|
|
48da38 |
diff -urNp a/src/libjasper/jp2/jp2_dec.c b/src/libjasper/jp2/jp2_dec.c
|
|
|
48da38 |
--- a/src/libjasper/jp2/jp2_dec.c 2021-06-01 13:32:59.330396797 +0200
|
|
|
48da38 |
+++ b/src/libjasper/jp2/jp2_dec.c 2021-06-01 13:46:16.982925961 +0200
|
|
|
48da38 |
@@ -230,7 +230,8 @@ jas_image_t *jp2_decode(jas_stream_t *in
|
|
|
48da38 |
the value specified in the code stream? */
|
|
|
48da38 |
if (dec->ihdr->data.ihdr.numcmpts != JAS_CAST(jas_uint,
|
|
|
48da38 |
jas_image_numcmpts(dec->image))) {
|
|
|
48da38 |
- jas_eprintf("warning: number of components mismatch\n");
|
|
|
48da38 |
+ jas_eprintf("error: number of components mismatch (IHDR)\n");
|
|
|
48da38 |
+ goto error;
|
|
|
48da38 |
}
|
|
|
48da38 |
|
|
|
48da38 |
/* At least one component must be present. */
|
|
|
48da38 |
@@ -253,7 +254,8 @@ jas_image_t *jp2_decode(jas_stream_t *in
|
|
|
48da38 |
with the data in the code stream? */
|
|
|
48da38 |
if ((samedtype && dec->ihdr->data.ihdr.bpc != JP2_DTYPETOBPC(dtype)) ||
|
|
|
48da38 |
(!samedtype && dec->ihdr->data.ihdr.bpc != JP2_IHDR_BPCNULL)) {
|
|
|
48da38 |
- jas_eprintf("warning: component data type mismatch\n");
|
|
|
48da38 |
+ jas_eprintf("error: component data type mismatch (IHDR)\n");
|
|
|
48da38 |
+ goto error;
|
|
|
48da38 |
}
|
|
|
48da38 |
|
|
|
48da38 |
/* Is the compression type supported? */
|
|
|
48da38 |
@@ -265,9 +267,10 @@ jas_image_t *jp2_decode(jas_stream_t *in
|
|
|
48da38 |
if (dec->bpcc) {
|
|
|
48da38 |
/* Is the number of components indicated in the BPCC box
|
|
|
48da38 |
consistent with the code stream data? */
|
|
|
48da38 |
- if (dec->bpcc->data.bpcc.numcmpts != JAS_CAST(jas_uint, jas_image_numcmpts(
|
|
|
48da38 |
- dec->image))) {
|
|
|
48da38 |
- jas_eprintf("warning: number of components mismatch\n");
|
|
|
48da38 |
+ if (dec->bpcc->data.bpcc.numcmpts !=
|
|
|
48da38 |
+ JAS_CAST(jas_uint, jas_image_numcmpts(dec->image))) {
|
|
|
48da38 |
+ jas_eprintf("error: number of components mismatch (BPCC)\n");
|
|
|
48da38 |
+ goto error;
|
|
|
48da38 |
}
|
|
|
48da38 |
/* Is the component data type information indicated in the BPCC
|
|
|
48da38 |
box consistent with the code stream data? */
|
|
|
48da38 |
@@ -276,7 +279,8 @@ jas_image_t *jp2_decode(jas_stream_t *in
|
|
|
48da38 |
++i) {
|
|
|
48da38 |
if (jas_image_cmptdtype(dec->image, i) !=
|
|
|
48da38 |
JP2_BPCTODTYPE(dec->bpcc->data.bpcc.bpcs[i])) {
|
|
|
48da38 |
- jas_eprintf("warning: component data type mismatch\n");
|
|
|
48da38 |
+ jas_eprintf("error: component data type mismatch (BPCC)\n");
|
|
|
48da38 |
+ goto error;
|
|
|
48da38 |
}
|
|
|
48da38 |
}
|
|
|
48da38 |
} else {
|