summaryrefslogtreecommitdiffstats
path: root/src/3rdparty/libtiff/libtiff/tif_luv.c
diff options
context:
space:
mode:
authorEirik Aavitsland <eirik.aavitsland@theqtcompany.com>2015-11-25 14:25:31 +0100
committeraavit <eirik.aavitsland@theqtcompany.com>2015-12-09 12:25:16 +0000
commit6730d70f001c9492d32a6a8e95c304a52d7ddc35 (patch)
tree1553ae391ec42af87ba32a52fa28f3cea2764980 /src/3rdparty/libtiff/libtiff/tif_luv.c
parentde4f14476c24eb4cf52948af92220a2a6462c823 (diff)
Bundled libtiff updated to version 4.0.6v5.6.0-beta1
Upstream changes since 4.0.3 have been merged in. Our local tif_conf.h have been updated according to the upstream changes in tif_conf.h.in. Change-Id: I1c2aef6f0f60377de4876e25df723c32a6f95ea6 Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
Diffstat (limited to 'src/3rdparty/libtiff/libtiff/tif_luv.c')
-rw-r--r--src/3rdparty/libtiff/libtiff/tif_luv.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/3rdparty/libtiff/libtiff/tif_luv.c b/src/3rdparty/libtiff/libtiff/tif_luv.c
index eba6c08..4e328ba 100644
--- a/src/3rdparty/libtiff/libtiff/tif_luv.c
+++ b/src/3rdparty/libtiff/libtiff/tif_luv.c
@@ -1,4 +1,4 @@
-/* $Id: tif_luv.c,v 1.35 2011-04-02 20:54:09 bfriesen Exp $ */
+/* $Id: tif_luv.c,v 1.40 2015-06-21 01:09:09 bfriesen Exp $ */
/*
* Copyright (c) 1997 Greg Ward Larson
@@ -379,6 +379,9 @@ LogLuvDecodeStrip(TIFF* tif, uint8* bp, tmsize_t cc, uint16 s)
{
tmsize_t rowlen = TIFFScanlineSize(tif);
+ if (rowlen == 0)
+ return 0;
+
assert(cc%rowlen == 0);
while (cc && (*tif->tif_decoderow)(tif, bp, rowlen, s))
bp += rowlen, cc -= rowlen;
@@ -395,6 +398,9 @@ LogLuvDecodeTile(TIFF* tif, uint8* bp, tmsize_t cc, uint16 s)
{
tmsize_t rowlen = TIFFTileRowSize(tif);
+ if (rowlen == 0)
+ return 0;
+
assert(cc%rowlen == 0);
while (cc && (*tif->tif_decoderow)(tif, bp, rowlen, s))
bp += rowlen, cc -= rowlen;
@@ -644,6 +650,9 @@ LogLuvEncodeStrip(TIFF* tif, uint8* bp, tmsize_t cc, uint16 s)
{
tmsize_t rowlen = TIFFScanlineSize(tif);
+ if (rowlen == 0)
+ return 0;
+
assert(cc%rowlen == 0);
while (cc && (*tif->tif_encoderow)(tif, bp, rowlen, s) == 1)
bp += rowlen, cc -= rowlen;
@@ -659,6 +668,9 @@ LogLuvEncodeTile(TIFF* tif, uint8* bp, tmsize_t cc, uint16 s)
{
tmsize_t rowlen = TIFFTileRowSize(tif);
+ if (rowlen == 0)
+ return 0;
+
assert(cc%rowlen == 0);
while (cc && (*tif->tif_encoderow)(tif, bp, rowlen, s) == 1)
bp += rowlen, cc -= rowlen;
@@ -683,7 +695,9 @@ LogLuvEncodeTile(TIFF* tif, uint8* bp, tmsize_t cc, uint16 s)
#ifndef M_PI
#define M_PI 3.14159265358979323846
#endif
+#undef log2 /* Conflict with C'99 function */
#define log2(x) ((1./M_LN2)*log(x))
+#undef exp2 /* Conflict with C'99 function */
#define exp2(x) exp(M_LN2*(x))
#define itrunc(x,m) ((m)==SGILOGENCODE_NODITHER ? \