1
From 266bc48054b018a2f1d74562aa48eb2f509436d5 Mon Sep 17 00:00:00 2001
2
From: erouault <erouault>
3
Date: Sun, 21 Dec 2014 17:36:36 +0000
4
Subject: [PATCH] * tools/tiff2pdf.c: check return code of TIFFGetField() when
5
reading TIFFTAG_SAMPLESPERPIXEL
9
tools/tiff2pdf.c | 10 +++++++++-
10
2 files changed, 14 insertions(+), 1 deletion(-)
12
Index: tiff-3.9.5/tools/tiff2pdf.c
13
===================================================================
14
--- tiff-3.9.5.orig/tools/tiff2pdf.c 2015-03-30 07:45:18.084130923 -0400
15
+++ tiff-3.9.5/tools/tiff2pdf.c 2015-03-30 07:45:18.084130923 -0400
16
@@ -1161,7 +1161,15 @@
17
t2p->tiff_pages[i].page_tilecount;
18
if( (TIFFGetField(input, TIFFTAG_PLANARCONFIG, &xuint16) != 0)
19
&& (xuint16 == PLANARCONFIG_SEPARATE ) ){
20
- TIFFGetField(input, TIFFTAG_SAMPLESPERPIXEL, &xuint16);
21
+ if( !TIFFGetField(input, TIFFTAG_SAMPLESPERPIXEL, &xuint16) )
25
+ "Missing SamplesPerPixel, %s",
26
+ TIFFFileName(input));
27
+ t2p->t2p_error = T2P_ERR_ERROR;
30
if( (t2p->tiff_tiles[i].tiles_tilecount % xuint16) != 0 )