[gs-cvs] rev 8817 - trunk/gs/src
giles at ghostscript.com
giles at ghostscript.com
Thu Jul 3 11:25:54 PDT 2008
Author: giles
Date: 2008-07-03 11:25:54 -0700 (Thu, 03 Jul 2008)
New Revision: 8817
Modified:
trunk/gs/src/sjpx.c
Log:
Fix a hang in s_jpxd_process. Bug 688807.
DETAILS:
The problem file contains a CMYK JPX stream, which jasper does not
recognize, treating it as sRGB with an extra component. This causes
us to try an return 3-component data, and end up looping forever if
only a fraction of the expected pixel is available at the end of a
line.
Check for this event and return an error instead.
Modified: trunk/gs/src/sjpx.c
===================================================================
--- trunk/gs/src/sjpx.c 2008-07-03 18:25:52 UTC (rev 8816)
+++ trunk/gs/src/sjpx.c 2008-07-03 18:25:54 UTC (rev 8817)
@@ -381,6 +381,9 @@
y = state->offset / stride;
x = state->offset - y*stride; /* bytes, not samples */
usable = min(out_size, stride - x);
+ /* Make sure we can return a full pixel.
+ This can fail if we get the colorspace wrong. */
+ if (usable < numcmpts) return ERRC;
x = x/numcmpts; /* now samples */
/* copy data out of the decoded image data */
/* be lazy and only write the rest of the current row */
More information about the gs-cvs
mailing list