Your message dated Sun, 02 Aug 2009 10:19:37 +0100
with message-id <4a755a29.2060...@sapo.pt>
and subject line This bug was already fixed upstream
has caused the Debian Bug report #537482,
regarding libpoppler3: Poppler generates invalid PostScript (arrays too long, 
results in /limitcheck in --array- from gs)
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact ow...@bugs.debian.org
immediately.)


-- 
537482: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=537482
Debian Bug Tracking System
Contact ow...@bugs.debian.org with problems
--- Begin Message ---
Package: libpoppler3
Version: 0.8.7-2
Severity: normal


Poppler in lenny needs the following patch (pulled from Ubuntu intrepid) to
produce correct PostScript output from some PDFs. Without it, it'll produce
PostScript that'll cause gs to choke with "/limitcheck in --array--".

See:

https://launchpad.net/bugs/311982

Patch is named 
63_do-not-make-ps-arrays-bigger-than-64k-from-big-images-in-patterns.patch in 
Intrepid's poppler sources.

This patch is not required for libpoppler4 in testing, as upstream have fixed 
the issue.



diff -Nur -x '*.orig' -x '*~' poppler-0.8.7/poppler/PSOutputDev.cc 
poppler-0.8.7.new/poppler/PSOutputDev.cc
--- poppler-0.8.7/poppler/PSOutputDev.cc        2008-06-01 16:35:25.000000000 
+0200
+++ poppler-0.8.7.new/poppler/PSOutputDev.cc    2009-01-02 14:20:25.000000000 
+0100
@@ -2591,6 +2591,7 @@
   GooString *s;
   int c;
   int size, line, col, i;
+  int outerSize, outer;
 
   // check if image is already setup
   for (i = 0; i < imgIDLen; ++i) {
@@ -2677,56 +2678,72 @@
   if (useRLE) {
     ++size;
   }
+  outerSize = size/65535 + 1;
+
   writePSFmt("{0:d} array dup /ImData_{1:d}_{2:d} exch def\n",
-            size, id.num, id.gen);
+            outerSize, id.num, id.gen);
   str->close();
 
   // write the data into the array
   str->reset();
-  line = col = 0;
-  writePS((char *)(useASCIIHex ? "dup 0 <" : "dup 0 <~"));
-  do {
-    do {
-      c = str->getChar();
-    } while (c == '\n' || c == '\r');
-    if (c == (useASCIIHex ? '>' : '~') || c == EOF) {
-      break;
-    }
-    if (c == 'z') {
-      writePSChar(c);
-      ++col;
-    } else {
-      writePSChar(c);
-      ++col;
-      for (i = 1; i <= (useASCIIHex ? 1 : 4); ++i) {
-       do {
-         c = str->getChar();
-       } while (c == '\n' || c == '\r');
-       if (c == (useASCIIHex ? '>' : '~') || c == EOF) {
-         break;
-       }
+  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);
+    line = col = 0;
+    writePS((char *)(useASCIIHex ? "dup 0 <" : "dup 0 <~"));
+    for (;;) {
+      do {
+       c = str->getChar();
+      } while (c == '\n' || c == '\r');
+      if (c == (useASCIIHex ? '>' : '~') || c == EOF) {
+       break;
+      }
+      if (c == 'z') {
        writePSChar(c);
        ++col;
+      } else {
+       writePSChar(c);
+       ++col;
+       for (i = 1; i <= (useASCIIHex ? 1 : 4); ++i) {
+         do {
+           c = str->getChar();
+         } while (c == '\n' || c == '\r');
+         if (c == (useASCIIHex ? '>' : '~') || c == EOF) {
+           break;
+         }
+         writePSChar(c);
+         ++col;
+       }
+      }
+      // each line is: "dup nnnnn <~...data...~> put<eol>"
+      // so max data length = 255 - 20 = 235
+      // chunks are 1 or 4 bytes each, so we have to stop at 232
+      // but make it 225 just to be safe
+      if (col > 225) {
+       writePS((char *)(useASCIIHex ? "> put\n" : "~> put\n"));
+       ++line;
+       if (line >= innerSize) break;
+       writePSFmt((char *)(useASCIIHex ? "dup {0:d} <" : "dup {0:d} <~"), 
line);
+       col = 0;
       }
     }
-    // each line is: "dup nnnnn <~...data...~> put<eol>"
-    // so max data length = 255 - 20 = 235
-    // chunks are 1 or 4 bytes each, so we have to stop at 232
-    // but make it 225 just to be safe
-    if (col > 225) {
+    if (c == (useASCIIHex ? '>' : '~') || c == EOF) {
       writePS((char *)(useASCIIHex ? "> put\n" : "~> put\n"));
-      ++line;
-      writePSFmt((char *)(useASCIIHex ? "dup {0:d} <" : "dup {0:d} <~"), line);
-      col = 0;
+      if (useRLE) {
+       ++line;
+       writePSFmt("{0:d} <> put\n", line);
+      } else {
+       writePS("pop\n");
+      }
+      break;
     }
-  } while (c != (useASCIIHex ? '>' : '~') && c != EOF);
-  writePS((char *)(useASCIIHex ? "> put\n" : "~> put\n"));
-  if (useRLE) {
-    ++line;
-    writePSFmt("{0:d} <> put\n", line);
-  } else {
     writePS("pop\n");
+    size -= innerSize;
   }
+  writePS("pop\n");
   str->close();
 
   delete str;
@@ -4361,7 +4378,7 @@
       delete str;
     } else {
       // set up to use the array already created by setupImages()
-      writePSFmt("ImData_{0:d}_{1:d} 0\n", ref->getRefNum(), ref->getRefGen());
+      writePSFmt("ImData_{0:d}_{1:d} 0 0\n", ref->getRefNum(), 
ref->getRefGen());
     }
   }
 
@@ -4822,7 +4839,7 @@
       delete str2;
     } else {
       // set up to use the array already created by setupImages()
-      writePSFmt("ImData_{0:d}_{1:d} 0\n", ref->getRefNum(), ref->getRefGen());
+      writePSFmt("ImData_{0:d}_{1:d} 0 0\n",ref->getRefNum(), 
ref->getRefGen());
     }
   }
 
@@ -4876,7 +4893,12 @@
 
   // data source
   if (mode == psModeForm || inType3Char || preload) {
-    writePS("  /DataSource { 2 copy get exch 1 add exch }\n");
+    if (inlineImg) {
+      writePS("  /DataSource { 2 copy get exch 1 add exch }\n");
+    } else {
+      writePS("  /DataSource { dup 65535 ge { pop 1 add 0 } if 2 index 2"
+       " index get 1 index get exch 1 add exch }\n");
+    }
   } else {
     writePS("  /DataSource currentfile\n");
   }
@@ -4915,6 +4937,7 @@
     writePSFmt(">>\n{0:s}\n", colorMap ? "image" : "imagemask");
 
     // get rid of the array and index
+    if (!inlineImg) writePS("pop ");
     writePS("pop pop\n");
 
   } else {
@@ -5090,7 +5113,7 @@
       delete str2;
     } else {
       // set up to use the array already created by setupImages()
-      writePSFmt("ImData_{0:d}_{1:d} 0\n", ref->getRefNum(), ref->getRefGen());
+      writePSFmt("ImData_{0:d}_{1:d} 0 0\n", ref->getRefNum(), 
ref->getRefGen());
     }
   }
 
@@ -5161,7 +5184,12 @@
 
   // data source
   if (mode == psModeForm || inType3Char || preload) {
-    writePS("  /DataSource { 2 copy get exch 1 add exch }\n");
+    if (inlineImg) {
+       writePS("  /DataSource { 2 copy get exch 1 add exch }\n");
+    } else {
+       writePS("  /DataSource { dup 65535 ge { pop 1 add 0 } if 2 index 2"
+         " index get 1 index get exch 1 add exch }\n");
+    }
   } else {
     writePS("  /DataSource currentfile\n");
   }
@@ -5297,6 +5325,7 @@
 
   // get rid of the array and index
   if (mode == psModeForm || inType3Char || preload) {
+    if (!inlineImg) writePS("pop ");
     writePS("pop pop\n");
 
   // image data





-- System Information:
Debian Release: 5.0.2
  APT prefers stable
  APT policy: (500, 'stable')
Architecture: i386 (i686)

Kernel: Linux 2.6.18-5-686 (SMP w/1 CPU core)
Locale: LANG=en_AU.UTF-8, LC_CTYPE=en_AU.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/bash

Versions of packages libpoppler3 depends on:
ii  libc6                  2.7-18            GNU C Library: Shared libraries
ii  libfontconfig1         2.6.0-3           generic font configuration library
ii  libfreetype6           2.3.7-2+lenny1    FreeType 2 font engine, shared lib
ii  libgcc1                1:4.3.2-1.1       GCC support library
ii  libjpeg62              6b-14             The Independent JPEG Group's JPEG 
ii  libstdc++6             4.3.2-1.1         The GNU Standard C++ Library v3
ii  libxml2                2.6.32.dfsg-5     GNOME XML library
ii  zlib1g                 1:1.2.3.3.dfsg-12 compression library - runtime

libpoppler3 recommends no packages.

libpoppler3 suggests no packages.

-- no debconf information



--- End Message ---
--- Begin Message ---
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA256

Hi!

I'm closing this bug report, because it was been fixed in Debian unstable (sid).

Thank you

- --
Marco Rodrigues

http://Marco.Tondela.org
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (GNU/Linux)

iQIcBAEBCAAGBQJKdVooAAoJENDqNB6bSPIzXcIQAL1cisvRgvtVjfUUU5oPIaqN
qy+HckEXCsdGqrWzVkpdmJj2TijkDeZl5ehjWncJMyP4ZUPOgbMm5heWF8MC8Mnm
iIa26nKJbN63hVVwt7hJsbhf9PpXxLngw+BhQep1CgDLLUSQeRRaUYrSmdJRzBM9
wKQ70Ok6bxQBOoYtvKVNjZu3QnV6HUby/o5wsDqlXcjhh1TfurBkJjhs+EnpwtdD
zkT5cXs+/xrBB123DmmK8sVEibxteDwGemo/iFjntXPOtmHEik9uDjjyf13G+vmQ
7Ku3NexjiqQEsl2skq95FB4V/7seFs546k0paI+/lqIgmqhBLoZ30AvqXb29ufRs
WRi3JTjCe8SOju6YNz6l2EoUxZ1NY3nmsUwXClbhB3GyERDU/+OS3vzP4q8GQPOh
IY5h0l6bYD3FYpayL27aoybbH3qGV5FLqHmwSHeWr7z/lTi7hI9Hx2e7/QfmH/7i
aBwWQu32HX+W0o5mPi24uzvfs8HaaoMT879GjyvpnVuRMB3uP/kOEZIGo7Et+s7m
UQUyXLk+0dnHtLe38Z/7cEj2VFf+yvOcOQlbH3UJ+lW5WO2/rDJXK4OZy+7U5kAB
vbQO91A2BG/ijSmtWLiQtzXJXmGOG9ALQ6Y3dmUApSy+BUG7J91DS9ZsSuO8FMch
PJvHgfbb5RRcqzFszeg+
=2NVC
-----END PGP SIGNATURE-----


--- End Message ---

Reply via email to