summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlbert Astals Cid <aacid@kde.org>2018-07-18 20:31:27 +0200
committerAlbert Astals Cid <aacid@kde.org>2018-07-18 20:31:27 +0200
commit004e3c10df0abda214f0c293f9e269fdd979c5ee (patch)
tree10587dd6dfd3fd5060c432660bb743caed068059
parent155897f3cb88db5050b9d16dc50bfd8b660077b6 (diff)
Fix crash when Object has negative number
Spec says object number has to be > 0 and gen has to be >= 0 Reported by email
-rw-r--r--poppler/Parser.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/poppler/Parser.cc b/poppler/Parser.cc
index 39c9a967..8b0093e3 100644
--- a/poppler/Parser.cc
+++ b/poppler/Parser.cc
@@ -154,6 +154,11 @@ Object Parser::getObj(GBool simpleOnly,
const int gen = buf1.getInt();
shift();
shift();
+
+ if (unlikely(num <= 0 || gen < 0)) {
+ return Object();
+ }
+
return Object(num, gen);
} else {
return Object(num);