summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/libtiff/libtiff/tif_aux.c
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2016-12-12 15:42:24 +0100
committerJani Heikkinen <jani.heikkinen@qt.io>2016-12-13 11:06:00 +0000
commitcd2de115c6216ad747cf4803e65a4ce4af220795 (patch)
tree78ee3e9d0a733635058b3b506235cd8f1a24a031 /src/3rdparty/libtiff/libtiff/tif_aux.c
parenta4125f0c4e8988012fe2bf5b9f933ed63c3c97d0 (diff)
Bundled libtiff updated to version 4.0.7v5.8.0-rc1v5.8.0
This commit imports libtiff 4.0.7, including COPYRIGHT, ChangeLog, README, README.vms, RELEASE-DATE, TODO, VERSION and libtiff, port directories. In libtiff, only includes SConstruct, libtiff.def, libtiff.map, libtiffxx.map, tif_config.h-vms, header and source files. In port, only includes header and source files. Upstream changes since 4.0.6 have been merged in, includes 701ba023 and 52dd6b1e. Also updated version in qt_attribution.json. Conflicts: src/3rdparty/libtiff/libtiff/tif_win32.c src/3rdparty/libtiff/libtiff/tiffiop.h src/3rdparty/libtiff/port/strtoull.c src/3rdparty/libtiff/qt_attribution.json Change-Id: I7a7a55676c007fd2b3eeff2b2e3ca481eb5724d9 Reviewed-by: Liang Qi <liang.qi@qt.io> Reviewed-by: Eirik Aavitsland <eirik.aavitsland@qt.io>
Diffstat (limited to 'src/3rdparty/libtiff/libtiff/tif_aux.c')
-rw-r--r--src/3rdparty/libtiff/libtiff/tif_aux.c33
1 files changed, 22 insertions, 11 deletions
diff --git a/src/3rdparty/libtiff/libtiff/tif_aux.c b/src/3rdparty/libtiff/libtiff/tif_aux.c
index 927150a..3d35ba9 100644
--- a/src/3rdparty/libtiff/libtiff/tif_aux.c
+++ b/src/3rdparty/libtiff/libtiff/tif_aux.c
@@ -1,4 +1,4 @@
-/* $Id: tif_aux.c,v 1.26 2010-07-01 15:33:28 dron Exp $ */
+/* $Id: tif_aux.c,v 1.29 2016-11-11 20:45:53 erouault Exp $ */
/*
* Copyright (c) 1991-1997 Sam Leffler
@@ -100,7 +100,8 @@ TIFFDefaultTransferFunction(TIFFDirectory* td)
n = ((tmsize_t)1)<<td->td_bitspersample;
nbytes = n * sizeof (uint16);
- if (!(tf[0] = (uint16 *)_TIFFmalloc(nbytes)))
+ tf[0] = (uint16 *)_TIFFmalloc(nbytes);
+ if (tf[0] == NULL)
return 0;
tf[0][0] = 0;
for (i = 1; i < n; i++) {
@@ -109,10 +110,12 @@ TIFFDefaultTransferFunction(TIFFDirectory* td)
}
if (td->td_samplesperpixel - td->td_extrasamples > 1) {
- if (!(tf[1] = (uint16 *)_TIFFmalloc(nbytes)))
+ tf[1] = (uint16 *)_TIFFmalloc(nbytes);
+ if(tf[1] == NULL)
goto bad;
_TIFFmemcpy(tf[1], tf[0], nbytes);
- if (!(tf[2] = (uint16 *)_TIFFmalloc(nbytes)))
+ tf[2] = (uint16 *)_TIFFmalloc(nbytes);
+ if (tf[2] == NULL)
goto bad;
_TIFFmemcpy(tf[2], tf[0], nbytes);
}
@@ -134,7 +137,8 @@ TIFFDefaultRefBlackWhite(TIFFDirectory* td)
{
int i;
- if (!(td->td_refblackwhite = (float *)_TIFFmalloc(6*sizeof (float))))
+ td->td_refblackwhite = (float *)_TIFFmalloc(6*sizeof (float));
+ if (td->td_refblackwhite == NULL)
return 0;
if (td->td_photometric == PHOTOMETRIC_YCBCR) {
/*
@@ -163,7 +167,7 @@ TIFFDefaultRefBlackWhite(TIFFDirectory* td)
* value if the tag is not present in the directory.
*
* NB: We use the value in the directory, rather than
- * explcit values so that defaults exist only one
+ * explicit values so that defaults exist only one
* place in the library -- in TIFFDefaultDirectory.
*/
int
@@ -208,11 +212,18 @@ TIFFVGetFieldDefaulted(TIFF* tif, uint32 tag, va_list ap)
*va_arg(ap, uint16 *) = td->td_resolutionunit;
return (1);
case TIFFTAG_PREDICTOR:
- {
- TIFFPredictorState* sp = (TIFFPredictorState*) tif->tif_data;
- *va_arg(ap, uint16*) = (uint16) sp->predictor;
- return 1;
- }
+ {
+ TIFFPredictorState* sp = (TIFFPredictorState*) tif->tif_data;
+ if( sp == NULL )
+ {
+ TIFFErrorExt(tif->tif_clientdata, tif->tif_name,
+ "Cannot get \"Predictor\" tag as plugin is not configured");
+ *va_arg(ap, uint16*) = 0;
+ return 0;
+ }
+ *va_arg(ap, uint16*) = (uint16) sp->predictor;
+ return 1;
+ }
case TIFFTAG_DOTRANGE:
*va_arg(ap, uint16 *) = 0;
*va_arg(ap, uint16 *) = (1<<td->td_bitspersample)-1;