diff options
author | Even Rouault <even.rouault@spatialys.com> | 2022-11-27 20:34:40 +0000 |
---|---|---|
committer | Even Rouault <even.rouault@spatialys.com> | 2022-11-27 20:34:40 +0000 |
commit | 0be1bf06c790ecfd3d162c126e46b097d733e41c (patch) | |
tree | fdca90d46b377fb8180c79bcd82674deab17f83c | |
parent | 94854a8dbc9c25d94c9335fc3cb01071f8f1d78d (diff) | |
parent | d700853112caf9115ffab913c70dc5c3cf433d6e (diff) | |
download | libtiff-git-0be1bf06c790ecfd3d162c126e46b097d733e41c.tar.gz |
Merge branch 'tiffcrop_fix_#169' into 'master'
tiffcrop: Add check if (bps != 1) in writeSingleSection() for...
Closes #169
See merge request libtiff/libtiff!429
-rw-r--r-- | tools/tiffcrop.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/tools/tiffcrop.c b/tools/tiffcrop.c index 90f57583..554c7bcb 100644 --- a/tools/tiffcrop.c +++ b/tools/tiffcrop.c @@ -7545,6 +7545,11 @@ writeSingleSection(TIFF *in, TIFF *out, struct image_data *image, break; case COMPRESSION_CCITTFAX3: case COMPRESSION_CCITTFAX4: + if (bps != 1) { + TIFFError("writeCroppedImage", + "Group 3/4 compression is not usable with bps > 1"); + return (-1); + } if (compression == COMPRESSION_CCITTFAX3) { if (g3opts != (uint32_t) -1) TIFFSetField(out, TIFFTAG_GROUP3OPTIONS, g3opts); |