summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlbert Astals Cid <aacid@kde.org>2010-09-21 18:54:31 +0100
committerAlbert Astals Cid <aacid@kde.org>2010-09-21 18:54:31 +0100
commit39d140bfc0b8239bdd96d6a55842034ae5c05473 (patch)
tree980e681febbb8e49f1dee712105e7716d24a221e
parentc6a091512745771894b54a71613fd6b5ca1adcb3 (diff)
Fix crash in broken pdf (code < 0)
Found thanks to PDF provided by Joel Voss of Leviathan Security Group
-rw-r--r--fofi/FoFiType1.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/fofi/FoFiType1.cc b/fofi/FoFiType1.cc
index 25bdc0eb..3fe7f4f7 100644
--- a/fofi/FoFiType1.cc
+++ b/fofi/FoFiType1.cc
@@ -15,3 +15,3 @@
//
-// Copyright (C) 2005, 2008 Albert Astals Cid <aacid@kde.org>
+// Copyright (C) 2005, 2008, 2010 Albert Astals Cid <aacid@kde.org>
// Copyright (C) 2005 Kristian Høgsberg <krh@redhat.com>
@@ -33,2 +33,3 @@
#include "goo/gmem.h"
+#include "goo/GooLikely.h"
#include "FoFiEncodings.h"
@@ -245,3 +246,3 @@ void FoFiType1::parse() {
}
- if (code < 256) {
+ if (likely(code < 256 && code >= 0)) {
for (p = p2; *p == ' ' || *p == '\t'; ++p) ;