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

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