Bug 691296 - Missing NULL check in bbox_close_device()
Summary: Missing NULL check in bbox_close_device()
Status: RESOLVED FIXED
Alias: None
Product: Ghostscript
Classification: Unclassified
Component: General (show other bugs)
Version: unspecified
Hardware: PC Linux
: P1 blocker
Assignee: Ray Johnston
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2010-05-13 16:09 UTC by Tim Waugh
Modified: 2018-12-18 11:37 UTC (History)
2 users (show)

See Also:
Customer:
Word Size: ---


Attachments
ghostscript-bbox-close.patch (621 bytes, text/plain)
2010-05-13 16:09 UTC, Tim Waugh
Details
www.ti.com/ww/en/analog/led/slyt394a.pdf (6.55 MB, application/pdf)
2010-05-13 17:08 UTC, Hin-Tak Leung
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Tim Waugh 2010-05-13 16:09:05 UTC
Created attachment 6277 [details]
ghostscript-bbox-close.patch

When bbox_close_device() is called on a compositor wrapper bbox, there is no check before calling gs_closedevice on the target device.

Original bug report:
  https://bugzilla.redhat.com/show_bug.cgi?id=591624
Comment 1 Hin-Tak Leung 2010-05-13 16:56:15 UTC
Patch looks "obviously" correct and committed as r11235 . But it is a bit worrying that the target device is NULL there  (it shouldn't be). So leave this bug open when we find the regression and re-assign.
Comment 2 Hin-Tak Leung 2010-05-13 17:08:33 UTC
Created attachment 6278 [details]
www.ti.com/ww/en/analog/led/slyt394a.pdf

The test file (just in case it disappears off the internet).

Page 1 has a problem:

Processing pages 1 through 64.
Page 1
jasper (code 0) write component failed
jasper (code 0) error: cannot decode code stream
unable to decode JPX image data.

Luratech decoder can process it.

But regardless, page two crashes both jasper and luratech binaries, so is unrelated.
Comment 3 Hin-Tak Leung 2010-05-15 09:32:48 UTC
Reassign to author of the problematic patch from git-bisect:

r10369 | ray | 2009-11-23 17:35:16 +0000 (Mon, 23 Nov 2009) | 32 lines

Fix for segfault reported in 690880 with separation devices. The is_open flag
was not being properly maintained when put_params resulted in a target device
closing due to DeviceN color state changing.

This commit causes a regression with crash with the attached test file.
Comment 4 Ray Johnston 2017-10-16 13:10:29 UTC
Tested with 9.22 and the command line:

gs Bug691296.pdf

Command line not given, but due to reference to the bbox device, I deduce
that the default x11 device (on linux) was used.

This works for me no problem. Note that we now use openjpeg, which also
complains on page 1 with:
    openjpeg warning: Non conformant codestream TPsot==TNsot.
but no crash/segfault occurs.

I assume this has been fixed.