Commit ad7821c4 authored by Bob Friesenhahn's avatar Bob Friesenhahn

Check return status from TIFFWriteScanline() correctly in test programs.

parent 45a4c455
Pipeline #14264396 canceled with stage
/* $Id: ascii_tag.c,v 1.5.2.1 2010-06-08 18:50:43 bfriesen Exp $ */
/* $Id: ascii_tag.c,v 1.5.2.2 2013-12-17 14:45:12 bfriesen Exp $ */
/*
* Copyright (c) 2004, Andrey Kiselev <dron@ak4719.spb.edu>
......@@ -125,7 +125,7 @@ main(int argc, char **argv)
}
/* Write dummy pixel data. */
if (!TIFFWriteScanline(tif, buf, 0, 0) < 0) {
if (TIFFWriteScanline(tif, buf, 0, 0) == -1) {
fprintf (stderr, "Can't write image data.\n");
goto failure;
}
......
/* $Id: long_tag.c,v 1.3.2.1 2010-06-08 18:50:43 bfriesen Exp $ */
/* $Id: long_tag.c,v 1.3.2.2 2013-12-17 14:45:12 bfriesen Exp $ */
/*
* Copyright (c) 2004, Andrey Kiselev <dron@ak4719.spb.edu>
......@@ -109,7 +109,7 @@ main(int argc, char **argv)
}
/* Write dummy pixel data. */
if (!TIFFWriteScanline(tif, buf, 0, 0) < 0) {
if (TIFFWriteScanline(tif, buf, 0, 0) == -1) {
fprintf (stderr, "Can't write image data.\n");
goto failure;
}
......
/* $Id: short_tag.c,v 1.6.2.2 2010-06-10 22:52:45 bfriesen Exp $ */
/* $Id: short_tag.c,v 1.6.2.3 2013-12-17 14:45:12 bfriesen Exp $ */
/*
* Copyright (c) 2004, Andrey Kiselev <dron@ak4719.spb.edu>
......@@ -123,7 +123,7 @@ main(int argc, char **argv)
}
/* Write dummy pixel data. */
if (!TIFFWriteScanline(tif, buf, 0, 0) < 0) {
if (TIFFWriteScanline(tif, buf, 0, 0) == -1) {
fprintf (stderr, "Can't write image data.\n");
goto failure;
}
......
/* $Id: strip.c,v 1.3.2.2 2010-06-08 18:50:43 bfriesen Exp $ */
/* $Id: strip.c,v 1.3.2.3 2013-12-17 14:45:12 bfriesen Exp $ */
/*
* Copyright (c) 2004, Andrey Kiselev <dron@ak4719.spb.edu>
......@@ -278,7 +278,7 @@ write_scanlines(TIFF *tif, const tdata_t array, const tsize_t size)
}
for (offset = 0, row = 0; row < length; offset+=scanlinesize, row++) {
if (TIFFWriteScanline(tif, (char *)array + offset, row, 0) < 0) {
if (TIFFWriteScanline(tif, (char *)array + offset, row, 0) == -1) {
fprintf (stderr,
"Can't write image data at row %u.\n", row);
return -1;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment