imagetops outputs a wrong image when input image is larger than RIPCache #3901

Closed
michaelrsweet opened this Issue Jul 26, 2011 · 2 comments

Comments

Projects
None yet
1 participant
Collaborator

michaelrsweet commented Jul 26, 2011

Version: 1.5.0
CUPS.org User: sho-otani

imagetops outputs a wrong image when input image is larger than RIPCache.
This is because cachefile handling is wrong in filter/image.c.

It creates cachefile in flush_tile in image.c only if img->cachefile < 0 as follows.

if (img->cachefile < 0)
{
if ((img->cachefile = cupsTempFd(img->cachename,
sizeof(img->cachename))) < 0)
{

....

But img->cachefile is intialized to 0 in cupsImageOpen as follows.

img = calloc(sizeof(cups_image_t), 1);

And it's never set to a minus value.
So cachefile is not created even when RIPCache is overflow.

I think that img->cachefile should be intialized to a minus value as follows.

img = calloc(sizeof(cups_image_t), 1);

img->cachefile = -1;

Collaborator

michaelrsweet commented Aug 6, 2011

CUPS.org User: mike

Fixed in Subversion repository.

Collaborator

michaelrsweet commented Aug 6, 2011

"str3901.patch":

Index: filter/image.c

--- filter/image.c (revision 9862)
+++ filter/image.c (working copy)
@@ -349,9 +349,10 @@

  • Load the image as appropriate...
    */
  • img->max_ics = CUPS_TILE_MINIMUM;
  • img->xppi = 128;
  • img->yppi = 128;
  • img->cachefile = -1;
  • img->max_ics = CUPS_TILE_MINIMUM;
  • img->xppi = 128;
  • img->yppi = 128;

if (!memcmp(header, "GIF87a", 6) || !memcmp(header, "GIF89a", 6))
status = _cupsImageReadGIF(img, fp, primary, secondary, saturation, hue,

michaelrsweet added this to the Stable milestone Mar 17, 2016

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment