summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEven Rouault <even.rouault@spatialys.com>2023-05-06 18:46:35 +0000
committerEven Rouault <even.rouault@spatialys.com>2023-05-06 18:46:35 +0000
commit7ead6c42c70636c0ffec2e9ff3f16d614e37fb7b (patch)
tree2f3390e615449a063d06fec568f7eab9f3b7ea8b
parente53b14876f276d9bad75307055933754d94e80e1 (diff)
parentb5c7d4c4e03333ac16b5cfb11acaaeaa493334f8 (diff)
downloadlibtiff-git-7ead6c42c70636c0ffec2e9ff3f16d614e37fb7b.tar.gz
Merge branch 'tiffcrop_fix_553_multi-image-errors' into 'master'
tiffcrop: fix 553 by considering error return of writeSelections() Closes #553 See merge request libtiff/libtiff!485
-rw-r--r--tools/tiffcrop.c13
1 files changed, 9 insertions, 4 deletions
diff --git a/tools/tiffcrop.c b/tools/tiffcrop.c
index 24d0ca84..05a7c5f1 100644
--- a/tools/tiffcrop.c
+++ b/tools/tiffcrop.c
@@ -2822,9 +2822,14 @@ int main(int argc, char *argv[])
{ /* Whole image or sections not based on output page size */
if (crop.selections > 0)
{
- writeSelections(in, &out, &crop, &image, &dump, seg_buffs,
- mp, argv[argc - 1], &next_page,
- total_pages);
+ if (writeSelections(in, &out, &crop, &image, &dump,
+ seg_buffs, mp, argv[argc - 1],
+ &next_page, total_pages))
+ {
+ TIFFError("main",
+ "Unable to write new image selections");
+ exit(EXIT_FAILURE);
+ }
}
else /* One file all images and sections */
{
@@ -8785,7 +8790,7 @@ static int createCroppedImage(struct image_data *image, struct crop_mask *crop,
/* Memory is freed before crop_buff_ptr is overwritten */
if (*crop_buff_ptr != NULL)
{
- _TIFFfree(*crop_buff_ptr);
+ _TIFFfree(*crop_buff_ptr);
}
/* process full image, no crop buffer needed */