The customer reports and I've verified that Ghostscript reports the warning "Warning: Pattern stream has unbalanced q/Q operators (too many q's)" before generating a "/typcheck in --run--" error. This occurs with all versions of Ghostscript I tested, including head (d0055ac144c1f1a51e906976b85e8e2119b5a2db). The command line I'm using for testing: bin/gs -sDEVICE=ppmraw -o test.ppm ./Canton_Landscape_bed_layout.pdf Acrobat 10 and Apple Preview read the file without difficulty, mupdf produces the message: Assertion failed: (contrib_cols == NULL || contrib_cols->count == dst_w_int), function fz_scale_pixmap, file draw/draw_scale.c, line 1091.
The file has a rather long number: 36.00000 0.00000 0.00000 36.00000 0.0000 -43583108498802323000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000.0000 cm If this number is replaced with an ordinary one, the file runs to completion.
The same line causes the problem in mupdf - the scale function is entered with an invalid matrix. A fix for this has been developed and is working it's way into the mupdf repo now.
Make pattern handling code tolerant to pattern streams that leave some junk on the operand stack. For instance, this can happen when processing of a stream terminates prematurely. http://git.ghostscript.com/?p=ghostpdl.git;a=commitdiff;h=db4af9eaf902dbac931ca8c88c586df9d160fb72