RE: Fix for 688018 (PreserveHalftones in pdfwrite)

"Dan Coby" <[email protected]> Tue, 12 Apr 2005 15:28:43 -0700
Newsgroups gmane.comp.printing.ghostscript.patches
Message-ID <[email protected]>
Ray,

+ #define CHECK(expr)\
+   BEGIN if ((code = (expr)) < 0) return code; END

I remember a long discussion in which we (including you) specifically
told Igor not to create a macro like this one which hides the control
flow.


Dan


-----Original Message-----
From: [email protected]
[mailto:[email protected]]On Behalf Of Ray Johnston
Sent: Tuesday, April 12, 2005 2:20 PM
To: GS Code Review List
Cc: Raph Levien
Subject: [gs-code-review] Fix for 688018 (PreserveHalftones in pdfwrite)
| 


All,

I know this is usually Igor's area, but he's busy right now and
rather than divert his attention, I decided to look into this
SEGV in pdfwrite. Good learning oppurtunity for me :-)

The patch is attached.

Log message:

Fix for SEGV when PreserveHalftoneInfo=true is given as a
pdfwrite option. Bug 688018.

DETAILS:

The initial problem was that the num_comp was not being looked at
when HalftoneType 5 was written and if num_comp was 3, the 4th
element of ht_ids[] was being used (UMR-wise). The solution to
this was to only write the three halftones and to use the 'Green'
halftone (arbitrarily) for Default.

After fixing the SEGV, another problem surfaced because the object
dictionary was not being terminated with the ">>".

Since I suspected that the threshold_halftone writers were also
broken I tested with 258-01.ps and found more problems. This
code was also quite broken. Since the Threshold array is the
stream data for HalftoneType 6 and 16, I changed this a lot to
emit valid PDF.

EXPECTED DIFFERENCES:

None, since we don't set PreserveHalftoneInfo.
-- 
Ray Johnston
Director of Engineering                          Tel: (714) 484-0376
Artifex Software Inc.                            Fax: (714) 220-1022
______________________________________________________________________