Summary: | Regression from kpdf 3.4.1 (kpdf 0.4.2 cannot open PDF file anymore that used to work with 0.4.1) | ||
---|---|---|---|
Product: | [Unmaintained] kpdf | Reporter: | Michael Nottebrock <lofi> |
Component: | general | Assignee: | Albert Astals Cid <aacid> |
Status: | RESOLVED FIXED | ||
Severity: | normal | ||
Priority: | NOR | ||
Version: | unspecified | ||
Target Milestone: | --- | ||
Platform: | FreeBSD Ports | ||
OS: | FreeBSD | ||
Latest Commit: | Version Fixed In: | ||
Sentry Crash Report: |
Description
Michael Nottebrock
2005-08-02 02:58:56 UTC
N.B.: Latest kpdf from branches/3.4 doesn't work either. You mean that kpdf 0.4.1 + KDE 3.4.1 works but kpdf 0.4.1 + KDE 3.4.2 does not work? No, kpdf 0.4.2 + KDE 3.4.2 does not work, but kpdf 0.4.1 and KDE 3.4.2 does. Ok, i misunderstood you then. 3.4.2 has a few changes that can be responsible for that, if you can send me that pdf i can try to see why it is happening, i promise to delete the documents after fixing. SVN commit 442429 by aacid: Increase even more the bytes where we search for %%EOF up to the 1024 bytes the pdf spec says adobe checks for Michael that fixes the doc you sent me, does the same with all that failed for you? BUGS: 110000 M +6 -11 PDFDoc.cc --- branches/KDE/3.5/kdegraphics/kpdf/xpdf/xpdf/PDFDoc.cc #442428:442429 @@ -115,24 +115,19 @@ GBool PDFDoc::setup(GString *ownerPassword, GString *userPassword) { str->reset(); - char eof[9]; + char *eof = new char[1024]; int pos = str->getPos(); - str->setPos(8, -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] = str->getChar(); - eof[8] = '\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); Indeed it does. Thank you very much! |