[poppler] poppler/poppler: PDFDoc.cc,1.2,1.3

Kristian Høgsberg krh at bitplanet.net
Sun Aug 7 15:51:55 EST 2005


Brad Hards wrote:
> 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?

Hmm, I'd rather see something like

    for (i = 0; i < len - 5; i++)
      if (strncmp (eof + i, "%%EOF", 5) == 0)
        break;

etc.

Kristian



More information about the poppler mailing list