File jasper-CVE-2018-19539.patch of Package jasper.10809

Index: jasper-2.0.14/src/libjasper/base/jas_image.c
===================================================================
--- jasper-2.0.14.orig/src/libjasper/base/jas_image.c
+++ jasper-2.0.14/src/libjasper/base/jas_image.c
@@ -491,6 +491,10 @@ int jas_image_readcmpt(jas_image_t *imag
 	  image, cmptno, JAS_CAST(long, x), JAS_CAST(long, y),
 	  JAS_CAST(long, width), JAS_CAST(long, height), data));
 
+	if(data == NULL) {
+		return -1;
+	}
+
 	if (cmptno < 0 || cmptno >= image->numcmpts_) {
 		return -1;
 	}