[gs-bugs] [Bug 692569] Regression: seg fault reading PDF file

bugzilla-daemon at ghostscript.com bugzilla-daemon at ghostscript.com
Mon Oct 10 18:51:32 UTC 2011


http://bugs.ghostscript.com/show_bug.cgi?id=692569

Robin Watts <robin.watts at artifex.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |michael.vrhel at artifex.com

--- Comment #3 from Robin Watts <robin.watts at artifex.com> 2011-10-10 18:51:31 UTC ---
The problem is that image_render_mono_ht is called with xci = -1. This causes
offset_bits to be calculated as 17 (when we really expect a number 0 <
offset_bits <= 15).

I can fix the problem with:

diff --git a/gs/base/gximono.c b/gs/base/gximono.c
index c3c4c07..916bb53 100644
--- a/gs/base/gximono.c
+++ b/gs/base/gximono.c
@@ -885,10 +885,13 @@ image_render_mono_ht(gx_image_enum * penum_orig, const
byt                 if (penum->ht_landscape.index < 0) {
                     penum->ht_landscape.xstart = penum->xci + vdi - 1;
                     offset_bits = (penum->ht_landscape.xstart % 16) + 1;
+                    /* xci can be negative, so allow for that */
+                    if (offset_bits <= 0) offset_bits += 16;
                 } else {
                     penum->ht_landscape.xstart = penum->xci;
+                    /* xci can be negative, see Bug 692569. */
                     offset_bits = 16 - penum->xci % 16;
-                    if (offset_bits == 16) offset_bits = 0;
+                    if (offset_bits >= 16) offset_bits -= 16;
                 }
                 if (offset_bits == 0 || offset_bits == 16) {
                     penum->ht_landscape.offset_set = false;

But that leaves the question, why are we getting xci < 0 ?

Michael?

-- 
Configure bugmail: http://bugs.ghostscript.com/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.


More information about the gs-bugs mailing list