https://github.com/libsdl-org/libtiff/commit/e01d959451da80ac65c4867c8835d79785e60b17
From e01d959451da80ac65c4867c8835d79785e60b17 Mon Sep 17 00:00:00 2001
From: Frank Warmerdam <[EMAIL REDACTED]>
Date: Tue, 30 Jun 2009 17:06:25 +0000
Subject: [PATCH] correct return codes from encode row to 1 on success instead
of zero (#2069)
---
ChangeLog | 6 ++++++
libtiff/tif_luv.c | 12 ++++++------
2 files changed, 12 insertions(+), 6 deletions(-)
diff --git a/ChangeLog b/ChangeLog
index bde1fb40..b31a11c1 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2009-06-30 Frank Warmerdam <warmerdam@pobox.com>
+
+ * libtiff/tif_luv.c: correct return codes from encoderow to be
+ 1 on success instead of zero.
+ http://bugzilla.maptools.org/show_bug.cgi?id=2069
+
2009-06-22 Frank Warmerdam <warmerdam@pobox.com>
* libtiff/tif_lzw.c: Fix buffer underflow bug.
diff --git a/libtiff/tif_luv.c b/libtiff/tif_luv.c
index 7e308458..be8fceaf 100644
--- a/libtiff/tif_luv.c
+++ b/libtiff/tif_luv.c
@@ -1,4 +1,4 @@
-/* $Id: tif_luv.c,v 1.17.2.2 2009-02-12 18:08:40 fwarmerdam Exp $ */
+/* $Id: tif_luv.c,v 1.17.2.3 2009-06-30 17:06:25 fwarmerdam Exp $ */
/*
* Copyright (c) 1997 Greg Ward Larson
@@ -451,7 +451,7 @@ LogL16Encode(TIFF* tif, tidata_t bp, tsize_t cc, tsample_t s)
tif->tif_rawcp = op;
tif->tif_rawcc = tif->tif_rawdatasize - occ;
- return (0);
+ return (1);
}
/*
@@ -496,7 +496,7 @@ LogLuvEncode24(TIFF* tif, tidata_t bp, tsize_t cc, tsample_t s)
tif->tif_rawcp = op;
tif->tif_rawcc = tif->tif_rawdatasize - occ;
- return (0);
+ return (1);
}
/*
@@ -585,7 +585,7 @@ LogLuvEncode32(TIFF* tif, tidata_t bp, tsize_t cc, tsample_t s)
tif->tif_rawcp = op;
tif->tif_rawcc = tif->tif_rawdatasize - occ;
- return (0);
+ return (1);
}
/*
@@ -598,7 +598,7 @@ LogLuvEncodeStrip(TIFF* tif, tidata_t bp, tsize_t cc, tsample_t s)
tsize_t rowlen = TIFFScanlineSize(tif);
assert(cc%rowlen == 0);
- while (cc && (*tif->tif_encoderow)(tif, bp, rowlen, s) == 0)
+ while (cc && (*tif->tif_encoderow)(tif, bp, rowlen, s) == 1)
bp += rowlen, cc -= rowlen;
return (cc == 0);
}
@@ -613,7 +613,7 @@ LogLuvEncodeTile(TIFF* tif, tidata_t bp, tsize_t cc, tsample_t s)
tsize_t rowlen = TIFFTileRowSize(tif);
assert(cc%rowlen == 0);
- while (cc && (*tif->tif_encoderow)(tif, bp, rowlen, s) == 0)
+ while (cc && (*tif->tif_encoderow)(tif, bp, rowlen, s) == 1)
bp += rowlen, cc -= rowlen;
return (cc == 0);
}