transparent = buf[3];
}
- while (gif_get_block(fp, buf) != 0);
+ while (gif_get_block(fp, buf) != 0)
+ {
+ if(gif_eof)
+ {
+ return (-1);
+ }
+ }
break;
case ',' : /* cupsImage data */
temp += bpp;
if (xpos == img->xsize)
{
- _cupsImagePutRow(img, 0, ypos, img->xsize, pixels);
-
+ int res = _cupsImagePutRow(img, 0, ypos, img->xsize, pixels);
+ if(res)
+ {
+ return (-1);
+ }
xpos = 0;
temp = pixels;
* Local functions...
*/
-static void flush_tile(cups_image_t *img);
+static int flush_tile(cups_image_t *img);
static cups_ib_t *get_tile(cups_image_t *img, int x, int y);
* 'flush_tile()' - Flush the least-recently-used tile in the cache.
*/
-static void
+static int
flush_tile(cups_image_t *img) /* I - Image */
{
int bpp; /* Bytes per pixel */
bpp = cupsImageGetDepth(img);
+ if(img==NULL||img->first==NULL||img->first->tile==NULL)
+ {
+ return -1;
+ }
tile = img->first->tile;
if (!tile->dirty)
{
tile->ic = NULL;
- return;
+ return 0;
}
if (img->cachefile < 0)
{
tile->ic = NULL;
tile->dirty = 0;
- return;
+ return 0;
}
DEBUG_printf(("Created swap file \"%s\"...\n", img->cachename));
{
tile->ic = NULL;
tile->dirty = 0;
- return;
+ return 0;
}
}
else
{
tile->ic = NULL;
tile->dirty = 0;
- return;
+ return 0;
}
}
tile->ic = NULL;
tile->dirty = 0;
+ return 0;
}
{
DEBUG_printf(("Flushing old cache tile (%p)...\n", img->first));
- flush_tile(img);
+ int res = flush_tile(img);
+ if(res)
+ {
+ return NULL;
+ }
ic = img->first;
}