[Poppler-bugs] [Bug 46964] New: [patch] possible regression, poppler 4Mar12 pdftops makes postscript arrays 65535 times larger than 0.18.4

bugzilla-daemon at freedesktop.org bugzilla-daemon at freedesktop.org
Sun Mar 4 03:44:07 PST 2012


https://bugs.freedesktop.org/show_bug.cgi?id=46964

             Bug #: 46964
           Summary: [patch] possible regression, poppler 4Mar12 pdftops
                    makes postscript arrays 65535 times larger than 0.18.4
    Classification: Unclassified
           Product: poppler
           Version: unspecified
          Platform: Other
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: medium
         Component: utils
        AssignedTo: poppler-bugs at lists.freedesktop.org
        ReportedBy: williambader at hotmail.com


Created attachment 58010
  --> https://bugs.freedesktop.org/attachment.cgi?id=58010
patch against poppler cloned from git on 4Mar12

The size of arrays with image data changed from using "outerSize" to "size".
For example, when I compare "pdftops output-pdftopsbug.pdf" (my test file for
slanted text), I get sequences like the one below, where the "1 array dup" is
from 0.18.4 and the "<large number> array dup" is from a git clone from 4Mar12.
Since the 0.18.4 version works, I think that the larger allocation is
unnecessary and might cause problems by wasting memory in the postscript
interpreter.

William

Comparison of 0.18.4 and git 4Mar12.

-1 array dup /ImData_79_0 exch def
+1031 array dup /ImData_79_0 exch def
 1031 array 1 index 0 2 index put
 dup 0 ...
 dup 1 ...
 dup 1029 ...
 1030 <> put
 pop
-1 array dup /ImData_85_0 exch def
+1053 array dup /ImData_85_0 exch def
 1053 array 1 index 0 2 index put
 dup 0 ...
 dup 1 ...
@@ -24587,7 +24595,7 @@
 dup 1051 ...
 1052 <> put
 pop
-1 array dup /ImData_91_0 exch def
+1062 array dup /ImData_91_0 exch def
 1062 array 1 index 0 2 index put

PSOutput.cc switched from using "outerSize" in 0.18.4 to "size" in git 4Mar12.

--- /u3/gnu/poppler-0.18.4-wb/poppler/PSOutputDev.cc    2012-02-23
04:45:01.768411089 +0100
+++ /u3/gnu/poppler-git-4mar12-wb/poppler/PSOutputDev.cc        2012-03-04
19:50:18.430407830 +0100
@@ -2780,22 +2851,22 @@
     }
   } while (c != (useASCIIHex ? '>' : '~') && c != EOF);
   // add one entry for the final line of data; add another entry
   // because the RunLengthDecode filter may read past the end
   ++size;
   if (useRLE) {
     ++size;
   }
   outerSize = size/65535 + 1;

-  writePSFmt("{0:d} array dup /ImData_{1:d}_{2:d} exch def\n",
-            outerSize, id.num, id.gen);
+  writePSFmt("{0:d} array dup /{1:s}Data_{2:d}_{3:d} exch def\n",
+            size, mask ? "Mask" : "Im", id.num, id.gen);
   str->close();

   // write the data into the array
   str->reset();
   for (outer = 0;outer < outerSize;outer++) {
     int innerSize = size > 65535 ? 65535 : size;

     // put the inner array into the outer array
     writePSFmt("{0:d} array 1 index {1:d} 2 index put\n",
               innerSize, outer);

-- 
Configure bugmail: https://bugs.freedesktop.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the assignee for the bug.


More information about the Poppler-bugs mailing list