Created attachment 13465 [details] type 5 halftone with type 3 sub-halftones (threshold arrays) The (to be attached) files include a type 5 halftone with type sub-dictionaries for each colourant. When run with the tiffsep1 device this causes a segmentation fault in threshold_from_order() at around line 2174 in gdevtsep.c This appears to be because the code in this function is expecting that the data pointed to by the opaque pointer in d_order->bit_data will be an array of gx_ht_bit structures, from which it will construct a threshold array. However, in gxhtbit.c, construct_ht_order_short() (around line 79) we appear to be filling the memory pointed to by bit_data with actual threshold array values. Its entirely possible that I'm missing soemthing here (this is not an area I know much about), but it looks like there is a disconnect between the data being stored in the pointer between the two ends. I don't really think its great that tiffsep1 is doing its own halftoning, it would be better if it was using the graphics library. However, in any event it should not crash.
Created attachment 13466 [details] original PDF file exposing the problem (almost certainly any file will actually do the same) Executing the type 5 halftone with type 3 sub-halftones, then sending this file to Ghostscript will result in a crash.
Created attachment 13467 [details] type 5 halftone with type 1 sub-halftones Using this hlftone instead of the threshold arrays version will not crash.
According to 'who owns what' the tiffsep1 device is owned by Henry and Ray. Going by a short discussion today (around 17:00) on #artifex, it looks like Ray is more likely the correct person to look at this problem.
Fixed in commit 16b7f4 Threshold arrays create a different type of gx_ht_order than screen type halftones so the bit_data is short X,Y coordinates instead of offset,mask (gx_ht_bit) elements that the tiffsep1 "threshold_from_order" code was expecting. Using the bit_index proc of the order works for all gx_ht_order types. TODO: determine if it is possible to use the gx_ht_construct_threshold function. This function is used in the FAST_HT_CODE used for some images to halftone devices that need halftoning.
*** Bug 693505 has been marked as a duplicate of this bug. ***