Index: third_party/libtiff/tif_luv.c |
diff --git a/third_party/tiff_v403/tif_luv.c b/third_party/libtiff/tif_luv.c |
similarity index 99% |
rename from third_party/tiff_v403/tif_luv.c |
rename to third_party/libtiff/tif_luv.c |
index 88f4ee85a0a7610cbbffed112e60487ffb02eeb1..4e328bad80982ca154c24d849d2dbd16d393af19 100644 |
--- a/third_party/tiff_v403/tif_luv.c |
+++ b/third_party/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 |
@@ -23,6 +23,7 @@ |
* LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE |
* OF THIS SOFTWARE. |
*/ |
+ |
#include "tiffiop.h" |
#ifdef LOGLUV_SUPPORT |
@@ -378,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; |
@@ -394,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; |
@@ -643,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; |
@@ -658,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; |
@@ -682,9 +695,9 @@ LogLuvEncodeTile(TIFF* tif, uint8* bp, tmsize_t cc, uint16 s) |
#ifndef M_PI |
#define M_PI 3.14159265358979323846 |
#endif |
-#ifndef log2 |
+#undef log2 /* Conflict with C'99 function */ |
#define log2(x) ((1./M_LN2)*log(x)) |
-#endif |
+#undef exp2 /* Conflict with C'99 function */ |
#define exp2(x) exp(M_LN2*(x)) |
#define itrunc(x,m) ((m)==SGILOGENCODE_NODITHER ? \ |
@@ -1682,4 +1695,3 @@ bad: |
* fill-column: 78 |
* End: |
*/ |
- |