As the SGray color space was not mentioned in the switch for selecting
the raster line formatting function, a 3-channel color formatting
function was selected instead of the 1-channel grayscale one, leading
to an overrun of the input pixel line, causing a crash.
This is fixed now by also mentioning the 3 standard color spaces for
driverless printing, SGray, SRGB, and AdobeRGB explicily (where for
the latter 2 the selection already worked as they are 3-channel color
options).
Fixes https://github.com/OpenPrinting/cups-filters/issues/435
(cherry picked from commit
098579f7082b4acfe628a1490c9c9abb3322cd74)
switch (header.cupsColorSpace)
{
case CUPS_CSPACE_W :
+ case CUPS_CSPACE_SW :
format_W(&header, row, y, plane, z->xsize, z->ysize,
yerr0, yerr1, r0, r1);
break;
default :
case CUPS_CSPACE_RGB :
+ case CUPS_CSPACE_SRGB :
+ case CUPS_CSPACE_ADOBERGB :
format_RGB(&header, row, y, plane, z->xsize, z->ysize,
yerr0, yerr1, r0, r1);
break;