1 From 58ba0365d911b9f9dd68e9abf826682c0b4f2293 Mon Sep 17 00:00:00 2001
2 From: Michael Adams <mdadams@ece.uvic.ca>
3 Date: Mon, 6 Mar 2017 08:06:54 -0800
4 Subject: [PATCH] Added a check in the JP2 encoder to ensure that the image to
5 be coded has at least one component.
7 Signed-off-by: Peter Korsgaard <peter@korsgaard.com>
9 src/libjasper/jp2/jp2_enc.c | 5 +++++
10 1 files changed, 1 insertions(+), 0 deletions(-)
12 diff --git a/src/libjasper/jp2/jp2_enc.c b/src/libjasper/jp2/jp2_enc.c
13 index 9a5e106..af4d9a4 100644
14 --- a/src/libjasper/jp2/jp2_enc.c
15 +++ b/src/libjasper/jp2/jp2_enc.c
16 @@ -115,6 +115,11 @@ int jp2_encode(jas_image_t *image, jas_stream_t *out, const char *optstr)
20 + if (jas_image_numcmpts(image) < 1) {
21 + jas_eprintf("image must have at least one component\n");
26 sgnd = jas_image_cmptsgnd(image, 0);
27 prec = jas_image_cmptprec(image, 0);