aboutsummaryrefslogtreecommitdiffstats
path: root/main/poppler/CVE-2019-9959.patch
blob: d417a698b2bed45d6d61a5953baefeca222fe692 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
diff --git a/poppler/JPEG2000Stream.cc b/poppler/JPEG2000Stream.cc
index 7daa23d..714d814 100644
--- a/poppler/JPEG2000Stream.cc
+++ b/poppler/JPEG2000Stream.cc
@@ -368,7 +368,7 @@ void JPXStream::init()
   if (getDict()) getDict()->lookup("SMaskInData", &smaskInData);
 
   int bufSize = BUFFER_INITIAL_SIZE;
-  if (oLen.isInt()) bufSize = oLen.getInt();
+  if (oLen.isInt() && oLen.getInt() > 0) bufSize = oLen.getInt();
   oLen.free();
 
   if (cspace.isArray() && cspace.arrayGetLength() > 0) {