Fix %%EOF checking

svn path=/branches/KDE/3.5/kdegraphics/kpdf/; revision=443937
remotes/origin/kpdf-3.5
Albert Astals Cid 21 years ago
parent 687d32c093
commit 76e961950b
  1. 10
      xpdf/xpdf/PDFDoc.cc

@ -127,7 +127,15 @@ GBool PDFDoc::setup(GString *ownerPassword, GString *userPassword) {
eof[i] = ch;
}
eof[i] = '\0';
if (strstr(eof, "%%EOF") == NULL)
bool found = false;
for (i = i - 5; i >= 0; i--) {
if (strncmp (&eof[i], "%%EOF", 5) == 0) {
found = true;
break;
}
}
if (!found)
{
error(-1, "Document does not have ending %%EOF");
errCode = errDamaged;

Loading…
Cancel
Save