Blame SOURCES/jasper-CVE-2016-9390.patch

83be9e
Backport of the upstream commit:
83be9e
83be9e
From ba2b9d000660313af7b692542afbd374c5685865 Mon Sep 17 00:00:00 2001
83be9e
From: Michael Adams <mdadams@ece.uvic.ca>
83be9e
Date: Tue, 25 Oct 2016 16:18:51 -0700
83be9e
Subject: [PATCH] Ensure that not all tiles lie outside the image area.
83be9e
83be9e
diff -pruN jasper-1.900.1.orig/src/libjasper/jpc/jpc_cs.c jasper-1.900.1/src/libjasper/jpc/jpc_cs.c
83be9e
--- jasper-1.900.1.orig/src/libjasper/jpc/jpc_cs.c	2017-03-29 22:24:57.000000000 +0200
83be9e
+++ jasper-1.900.1/src/libjasper/jpc/jpc_cs.c	2017-03-29 22:25:48.000000000 +0200
83be9e
@@ -502,6 +502,10 @@ static int jpc_siz_getparms(jpc_ms_t *ms
83be9e
 	  !siz->tileheight || !siz->numcomps) {
83be9e
 		return -1;
83be9e
 	}
83be9e
+	if (siz->tilexoff >= siz->width || siz->tileyoff >= siz->height) {
83be9e
+		jas_eprintf("all tiles are outside the image area\n");
83be9e
+		return -1;
83be9e
+	}
83be9e
 	if (!(siz->comps = jas_alloc2(siz->numcomps, sizeof(jpc_sizcomp_t)))) {
83be9e
 		return -1;
83be9e
 	}