<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.kde.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugs.kde.org/"
          
          maintainer="sysadmin@kde.org"
>

    <bug>
          <bug_id>110000</bug_id>
          
          <creation_ts>2005-08-02 02:58:56 +0000</creation_ts>
          <short_desc>Regression from kpdf 3.4.1 (kpdf 0.4.2 cannot open PDF file anymore that used to work with 0.4.1)</short_desc>
          <delta_ts>2005-08-02 20:38:22 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>10</classification_id>
          <classification>Unmaintained</classification>
          <product>kpdf</product>
          <component>general</component>
          <version>unspecified</version>
          <rep_platform>FreeBSD Ports</rep_platform>
          <op_sys>FreeBSD</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>FIXED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords></keywords>
          <priority>NOR</priority>
          <bug_severity>normal</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>0</everconfirmed>
          <reporter name="Michael Nottebrock">lofi</reporter>
          <assigned_to name="Albert Astals Cid">aacid</assigned_to>
          
          
          <cf_commitlink></cf_commitlink>
          <cf_versionfixedin></cf_versionfixedin>
          <cf_sentryurl></cf_sentryurl>
          <votes>0</votes>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>362079</commentid>
    <comment_count>0</comment_count>
    <who name="Michael Nottebrock">lofi</who>
    <bug_when>2005-08-02 02:58:56 +0000</bug_when>
    <thetext>Version:            (using KDE KDE 3.4.2)
Installed from:    FreeBSD Ports
OS:                FreeBSD

It seems there are regressions in kpdf 3.4.2&apos;s code that prevent it from reading some PDFs of mine which all worked for me in kpdf 3.4.1 (and still do when I install kdegraphics 3.4.1 into my KDE 3.4.2 environment).

However: Those documents are my telephone and online bills, and I don&apos;t want to attach them to this bugreport for anyone to read. I can make them available to interested developers on request however - please reply to this bugreport or contact me directly.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>362090</commentid>
    <comment_count>1</comment_count>
    <who name="Michael Nottebrock">lofi</who>
    <bug_when>2005-08-02 03:40:37 +0000</bug_when>
    <thetext>N.B.: Latest kpdf from branches/3.4 doesn&apos;t work either.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>362220</commentid>
    <comment_count>2</comment_count>
    <who name="Albert Astals Cid">aacid</who>
    <bug_when>2005-08-02 16:01:22 +0000</bug_when>
    <thetext>You mean that kpdf 0.4.1 + KDE 3.4.1 works but kpdf 0.4.1 + KDE 3.4.2 does not work?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>362227</commentid>
    <comment_count>3</comment_count>
    <who name="Michael Nottebrock">lofi</who>
    <bug_when>2005-08-02 16:39:13 +0000</bug_when>
    <thetext>No, kpdf 0.4.2 + KDE 3.4.2 does not work, but kpdf 0.4.1 and KDE 3.4.2 does.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>362243</commentid>
    <comment_count>4</comment_count>
    <who name="Albert Astals Cid">aacid</who>
    <bug_when>2005-08-02 18:12:44 +0000</bug_when>
    <thetext>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.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>362260</commentid>
    <comment_count>5</comment_count>
    <who name="Albert Astals Cid">aacid</who>
    <bug_when>2005-08-02 19:08:20 +0000</bug_when>
    <thetext>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-&gt;reset();
   
-  char eof[9];
+  char *eof = new char[1024];
   int pos = str-&gt;getPos();
-  str-&gt;setPos(8, -1);
-  eof[0] = str-&gt;getChar();
-  eof[1] = str-&gt;getChar();
-  eof[2] = str-&gt;getChar();
-  eof[3] = str-&gt;getChar();
-  eof[4] = str-&gt;getChar();
-  eof[5] = str-&gt;getChar();
-  eof[6] = str-&gt;getChar();
-  eof[7] = str-&gt;getChar();
-  eof[8] = &apos;\0&apos;;
+  str-&gt;setPos(1024, -1);
+  for (int i = 0; i &lt; 1024; i++) eof[i] = str-&gt;getChar();
+  eof[1024] = &apos;\0&apos;;
   if (strstr(eof, &quot;%%EOF&quot;) == NULL)
   {
     error(-1, &quot;Document does not have ending %%EOF&quot;);
     errCode = errDamaged;
+    delete[] eof;
     return gFalse;
   }
+  delete[] eof;
   
   str-&gt;setPos(pos);
   
</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>362284</commentid>
    <comment_count>6</comment_count>
    <who name="Michael Nottebrock">lofi</who>
    <bug_when>2005-08-02 20:38:22 +0000</bug_when>
    <thetext>Indeed it does. Thank you very much!</thetext>
  </long_desc>
      
      

    </bug>

</bugzilla>