[poppler] poppler/poppler: PDFDoc.cc,1.2,1.3
Brad Hards
bradh at frogmouth.net
Sun Aug 7 10:31:51 EST 2005
On Sun, 7 Aug 2005 08:59 am, Brad Hards wrote:
> On Sat, 6 Aug 2005 21:47 pm, Albert Astals Cid wrote:
> > Update of /cvs/poppler/poppler/poppler
> > In directory gabe:/tmp/cvs-serv16924/poppler
> >
> > Modified Files:
> > PDFDoc.cc
> > Log Message:
> > Increase EOF searching up to last 1024 characters
>
> Hmm, that broke the qt4 unittests:
Actually, looks like most of the problem is one file - orientation.pdf. See
http://cvs.freedesktop.org/poppler/test/unittestcases/orientation.pdf?rev=1.1&view=log
I think that the problem is that strstr() stops at the first 0x00, and that
file (plus a few others I found, mostly linearized and/or encrypted) do have
embedded 0x00's. I hacked it (see below) to avoid putting those into eof[],
and it now Works For Me(tm).
Should I commit this, ugly as it is?
Brad
Index: poppler/PDFDoc.cc
===================================================================
RCS file: /cvs/poppler/poppler/poppler/PDFDoc.cc,v
retrieving revision 1.4
diff -u -4 -p -r1.4 PDFDoc.cc
--- poppler/PDFDoc.cc 6 Aug 2005 11:58:59 -0000 1.4
+++ poppler/PDFDoc.cc 7 Aug 2005 00:31:19 -0000
@@ -185,14 +185,18 @@ GBool PDFDoc::checkFooter() {
{
ch = str->getChar();
if (ch == EOF)
break;
- eof[i] = ch;
+ if (0x00 != ch) {
+ eof[i] = ch;
+ } else {
+ eof[i] = 0x01;
+ }
}
eof[i] = '\0';
if (strstr(eof, "%%EOF") == NULL)
{
- error(-1, "Document has not the mandatory ending %%EOF");
+ error(-1, "Document does not have the mandatory ending %%%%EOF");
errCode = errDamaged;
delete[] eof;
return gFalse;
}
Brad
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/poppler/attachments/20050807/8daad212/attachment.pgp
More information about the poppler
mailing list