diff options
author | Even Rouault <even.rouault@spatialys.com> | 2021-12-16 23:57:49 +0100 |
---|---|---|
committer | Even Rouault <even.rouault@spatialys.com> | 2021-12-16 23:57:49 +0100 |
commit | e533f45709089b461c622fcb6510843725fb7bcc (patch) | |
tree | cbc5b512e0d1b99d627c7d58e4a5f5c5ae922726 | |
parent | 1d1299a670efb393d077250b5bb00d22c71e8e4c (diff) | |
download | libtiff-git-e533f45709089b461c622fcb6510843725fb7bcc.tar.gz |
tiff2pdf: validate TIFFGetField(input, TIFFTAG_STRIPBYTECOUNTS, &sbc) return (fixes #342)
-rw-r--r-- | tools/tiff2pdf.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/tools/tiff2pdf.c b/tools/tiff2pdf.c index 99c2cc8e..0bd909fb 100644 --- a/tools/tiff2pdf.c +++ b/tools/tiff2pdf.c @@ -1991,7 +1991,13 @@ void t2p_read_tiff_size(T2P* t2p, TIFF* input){ if(t2p->pdf_compression == T2P_COMPRESS_ZIP) #endif { - TIFFGetField(input, TIFFTAG_STRIPBYTECOUNTS, &sbc); + if(!TIFFGetField(input, TIFFTAG_STRIPBYTECOUNTS, &sbc)){ + TIFFError(TIFF2PDF_MODULE, + "Input file %s missing field: TIFFTAG_STRIPBYTECOUNTS", + TIFFFileName(input)); + t2p->t2p_error = T2P_ERR_ERROR; + return; + } t2p_set_tiff_datasize(t2p, sbc[0]); return; } |