From f7bd35fd7cc7e9c217d1f09f47b223bed7edb313 Mon Sep 17 00:00:00 2001 From: Albert Astals Cid Date: Tue, 2 Aug 2005 16:41:36 +0000 Subject: [PATCH] Increase the range in which we look for %%EOF BUGS: 110034 svn path=/branches/KDE/3.5/kdegraphics/kpdf/; revision=442420 --- xpdf/xpdf/PDFDoc.cc | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/xpdf/xpdf/PDFDoc.cc b/xpdf/xpdf/PDFDoc.cc index efcda9533..49bf61493 100644 --- a/xpdf/xpdf/PDFDoc.cc +++ b/xpdf/xpdf/PDFDoc.cc @@ -115,9 +115,9 @@ PDFDoc::PDFDoc(BaseStream *strA, GString *ownerPassword, GBool PDFDoc::setup(GString *ownerPassword, GString *userPassword) { str->reset(); - char eof[8]; + char eof[9]; int pos = str->getPos(); - str->setPos(7, -1); + str->setPos(8, -1); eof[0] = str->getChar(); eof[1] = str->getChar(); eof[2] = str->getChar(); @@ -125,10 +125,11 @@ GBool PDFDoc::setup(GString *ownerPassword, GString *userPassword) { eof[4] = str->getChar(); eof[5] = str->getChar(); eof[6] = str->getChar(); - eof[7] = '\0'; + eof[7] = str->getChar(); + eof[8] = '\0'; if (strstr(eof, "%%EOF") == NULL) { - error(-1, "Document does not have ending %%EOF"); + error(-1, "Document does not have ending %%EOF"); errCode = errDamaged; return gFalse; }