summaryrefslogtreecommitdiff
blob: 5462c6e03539c5e4fc776eb8cfd7f30c4c5a444e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
diff -Nur kdegraphics-3.4.2.orig/kpdf/xpdf/xpdf/PDFDoc.cc kdegraphics-3.4.2/kpdf/xpdf/xpdf/PDFDoc.cc
--- kdegraphics-3.4.2.orig/kpdf/xpdf/xpdf/PDFDoc.cc	2005-07-20 12:00:36.000000000 +0200
+++ kdegraphics-3.4.2/kpdf/xpdf/xpdf/PDFDoc.cc	2005-08-05 11:46:39.000000000 +0200
@@ -115,23 +115,19 @@
 GBool PDFDoc::setup(GString *ownerPassword, GString *userPassword) {
   str->reset();
   
-  char eof[8];
+  char *eof = new char[1024];
   int pos = str->getPos();
-  str->setPos(7, -1);
-  eof[0] = str->getChar();
-  eof[1] = str->getChar();
-  eof[2] = str->getChar();
-  eof[3] = str->getChar();
-  eof[4] = str->getChar();
-  eof[5] = str->getChar();
-  eof[6] = str->getChar();
-  eof[7] = '\0';
+  str->setPos(1024, -1);
+  for (int i = 0; i < 1024; i++) eof[i] = str->getChar();
+  eof[1024] = '\0';
   if (strstr(eof, "%%EOF") == NULL)
   {
     error(-1, "Document does not have ending %%EOF");	      
     errCode = errDamaged;
+    delete[] eof;
     return gFalse;
   }
+  delete[] eof;
   
   str->setPos(pos);