75a61b
From b3425dd3261679958cd56c0f71995c15d2124433 Mon Sep 17 00:00:00 2001
75a61b
From: Albert Astals Cid <aacid@kde.org>
75a61b
Date: Tue, 22 Dec 2015 22:50:33 +0100
75a61b
Subject: Do not crash on invalid files
75a61b
75a61b
Bug #93476
75a61b
75a61b
diff --git a/poppler/Function.cc b/poppler/Function.cc
75a61b
index 67283df..ee5afc1 100644
75a61b
--- a/poppler/Function.cc
75a61b
+++ b/poppler/Function.cc
75a61b
@@ -577,6 +577,10 @@ ExponentialFunction::ExponentialFunction(Object *funcObj, Dict *dict) {
75a61b
       goto err2;
75a61b
     }
75a61b
     n = obj1.arrayGetLength();
75a61b
+    if (unlikely(n > funcMaxOutputs)) {
75a61b
+      error(errSyntaxError, -1, "Function's C0 array is wrong length");
75a61b
+      n = funcMaxOutputs;
75a61b
+    }
75a61b
     for (i = 0; i < n; ++i) {
75a61b
       obj1.arrayGet(i, &obj2);
75a61b
       if (!obj2.isNum()) {
75a61b
-- 
75a61b
cgit v0.10.2
75a61b