tiff/erouault.2858.patch

36 lines
1.1 KiB
Diff
Raw Normal View History

---------------------
PatchSet 2858
Date: 2014/12/21 19:36:36
Author: erouault
Branch: HEAD
Tag: (none)
Log:
* tools/tiff2pdf.c: check return code of TIFFGetField() when reading
TIFFTAG_SAMPLESPERPIXEL
Members:
ChangeLog:1.962->1.963
tools/tiff2pdf.c:1.78->1.79
Index: libtiff/tools/tiff2pdf.c
diff -u libtiff/tools/tiff2pdf.c:1.78 libtiff/tools/tiff2pdf.c:1.79
--- libtiff/tools/tiff2pdf.c:1.78 Sun Dec 21 10:15:32 2014
+++ libtiff/tools/tiff2pdf.c Sun Dec 21 12:36:36 2014
@@ -1166,7 +1166,15 @@
t2p->tiff_pages[i].page_tilecount;
if( (TIFFGetField(input, TIFFTAG_PLANARCONFIG, &xuint16) != 0)
&& (xuint16 == PLANARCONFIG_SEPARATE ) ){
- TIFFGetField(input, TIFFTAG_SAMPLESPERPIXEL, &xuint16);
+ if( !TIFFGetField(input, TIFFTAG_SAMPLESPERPIXEL, &xuint16) )
+ {
+ TIFFError(
+ TIFF2PDF_MODULE,
+ "Missing SamplesPerPixel, %s",
+ TIFFFileName(input));
+ t2p->t2p_error = T2P_ERR_ERROR;
+ return;
+ }
if( (t2p->tiff_tiles[i].tiles_tilecount % xuint16) != 0 )
{
TIFFError(