File jasper-CVE-2018-19543-CVE-2017-9782.patch of Package jasper.18194

Index: jasper-1.900.14/src/libjasper/jp2/jp2_dec.c
===================================================================
--- jasper-1.900.14.orig/src/libjasper/jp2/jp2_dec.c
+++ jasper-1.900.14/src/libjasper/jp2/jp2_dec.c
@@ -400,7 +400,7 @@ jas_image_t *jp2_decode(jas_stream_t *in
 
 	/* Determine the type of each component. */
 	if (dec->cdef) {
-		for (i = 0; i < dec->numchans; ++i) {
+		for (i = 0; i < dec->cdef->data.cdef.numchans; ++i) {
 			/* Is the channel number reasonable? */
 			if (dec->cdef->data.cdef.ents[i].channo >= dec->numchans) {
 				jas_eprintf("error: invalid channel number in CDEF box\n");
openSUSE Build Service is sponsored by