File openjpeg2-CVE-2016-9118.patch of Package openjpeg2

From d87b8ae21082829f615c11105513d6e3be002fe6 Mon Sep 17 00:00:00 2001
From: Hans Petter Jansson <hpj@cl.no>
Date: Wed, 14 Dec 2016 23:34:19 +0100
Subject: [PATCH 6/9] CVE-2016-9118

---
 src/bin/jp2/convert.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/src/bin/jp2/convert.c b/src/bin/jp2/convert.c
index 14d9939..4adadc9 100644
--- a/src/bin/jp2/convert.c
+++ b/src/bin/jp2/convert.c
@@ -1726,6 +1726,7 @@ static void read_pnm_header(FILE *reader, struct pnm_header *ph)
         if(ph->maxval < 1 || ph->maxval > 65535) return;
     }
     if(ph->width < 1 || ph->height < 1) return;
+    if(ph->width > 32767 || ph->height > 32767) return;
 
     if(format == 7)
     {
-- 
1.8.4.5