summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/libtiff/libtiff/tif_getimage.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/3rdparty/libtiff/libtiff/tif_getimage.c')
-rw-r--r--src/3rdparty/libtiff/libtiff/tif_getimage.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/src/3rdparty/libtiff/libtiff/tif_getimage.c b/src/3rdparty/libtiff/libtiff/tif_getimage.c
index c51c889..fc554cc 100644
--- a/src/3rdparty/libtiff/libtiff/tif_getimage.c
+++ b/src/3rdparty/libtiff/libtiff/tif_getimage.c
@@ -1,4 +1,4 @@
-/* $Id: tif_getimage.c,v 1.112 2017-07-24 10:34:14 erouault Exp $ */
+/* $Id: tif_getimage.c,v 1.114 2017-11-17 20:21:00 erouault Exp $ */
/*
* Copyright (c) 1991-1997 Sam Leffler
@@ -138,7 +138,7 @@ TIFFRGBAImageOK(TIFF* tif, char emsg[1024])
/*
* TODO: if at all meaningful and useful, make more complete
* support check here, or better still, refactor to let supporting
- * code decide whether there is support and what meaningfull
+ * code decide whether there is support and what meaningful
* error to return
*/
break;
@@ -416,7 +416,7 @@ TIFFRGBAImageBegin(TIFFRGBAImage* img, TIFF* tif, int stop, char emsg[1024])
/*
* TODO: if at all meaningful and useful, make more complete
* support check here, or better still, refactor to let supporting
- * code decide whether there is support and what meaningfull
+ * code decide whether there is support and what meaningful
* error to return
*/
break;
@@ -2332,6 +2332,13 @@ initCIELabConversion(TIFFRGBAImage* img)
float *whitePoint;
float refWhite[3];
+ TIFFGetFieldDefaulted(img->tif, TIFFTAG_WHITEPOINT, &whitePoint);
+ if (whitePoint[1] == 0.0f ) {
+ TIFFErrorExt(img->tif->tif_clientdata, module,
+ "Invalid value for WhitePoint tag.");
+ return NULL;
+ }
+
if (!img->cielab) {
img->cielab = (TIFFCIELabToRGB *)
_TIFFmalloc(sizeof(TIFFCIELabToRGB));
@@ -2342,7 +2349,6 @@ initCIELabConversion(TIFFRGBAImage* img)
}
}
- TIFFGetFieldDefaulted(img->tif, TIFFTAG_WHITEPOINT, &whitePoint);
refWhite[1] = 100.0F;
refWhite[0] = whitePoint[0] / whitePoint[1] * refWhite[1];
refWhite[2] = (1.0F - whitePoint[0] - whitePoint[1])