Skip to content

Commit ee17c56

Browse files
authored
image-tiff.c: Unify return values
TIFF functions used different return values if there is error. Since we don't make difference in error types atm, unify the return value to -1.
1 parent fd01543 commit ee17c56

1 file changed

Lines changed: 7 additions & 7 deletions

File tree

cupsfilters/image-tiff.c

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -120,7 +120,7 @@ _cfImageReadTIFF(
120120
fputs("DEBUG: Images with planar color configuration are not supported!\n", stderr);
121121
TIFFClose(tif);
122122
fclose(fp);
123-
return (1);
123+
return (-1);
124124
}
125125

126126
if (!TIFFGetField(tif, TIFFTAG_COMPRESSION, &compression))
@@ -143,7 +143,7 @@ _cfImageReadTIFF(
143143
"Samples per pixel: %d; Bits per sample: %d\n", samples, bits);
144144
TIFFClose(tif);
145145
fclose(fp);
146-
return (1);
146+
return (-1);
147147
}
148148

149149
//
@@ -243,7 +243,7 @@ _cfImageReadTIFF(
243243
(unsigned)samples));
244244
TIFFClose(tif);
245245
fclose(fp);
246-
return (1);
246+
return (-1);
247247
}
248248

249249
//
@@ -365,15 +365,15 @@ _cfImageReadTIFF(
365365
DEBUG_puts("DEBUG: No enough memory.\n");
366366
TIFFClose(tif);
367367
fclose(fp);
368-
return (1);
368+
return (-1);
369369
}
370370
if ((out = (cf_ib_t*)calloc(img->xsize * bpp, sizeof(cf_ib_t))) == NULL)
371371
{
372372
DEBUG_puts("DEBUG: No enough memory.\n");
373373
free(in);
374374
TIFFClose(tif);
375375
fclose(fp);
376-
return (1);
376+
return (-1);
377377
}
378378
}
379379
else
@@ -388,15 +388,15 @@ _cfImageReadTIFF(
388388
DEBUG_puts("DEBUG: No enough memory.\n");
389389
TIFFClose(tif);
390390
fclose(fp);
391-
return (1);
391+
return (-1);
392392
}
393393
if ((out = (cf_ib_t*)calloc(img->ysize * bpp, sizeof(cf_ib_t))) == NULL)
394394
{
395395
DEBUG_puts("DEBUG: No enough memory.\n");
396396
free(in);
397397
TIFFClose(tif);
398398
fclose(fp);
399-
return (1);
399+
return (-1);
400400
}
401401
}
402402

0 commit comments

Comments
 (0)