Index: third_party/libtiff/tif_fax3.c |
diff --git a/third_party/tiff_v403/tif_fax3.c b/third_party/libtiff/tif_fax3.c |
similarity index 98% |
rename from third_party/tiff_v403/tif_fax3.c |
rename to third_party/libtiff/tif_fax3.c |
index 7ec8faa8b088ed701d3bc3f6b5992ff1f63a391e..bbe72555bee33318396b54d9d7f1e741f92d2a48 100644 |
--- a/third_party/tiff_v403/tif_fax3.c |
+++ b/third_party/libtiff/tif_fax3.c |
@@ -1,4 +1,4 @@ |
-/* $Id: tif_fax3.c,v 1.74 2012-06-21 02:01:31 fwarmerdam Exp $ */ |
+/* $Id: tif_fax3.c,v 1.75 2015-08-30 20:49:55 erouault Exp $ */ |
/* |
* Copyright (c) 1990-1997 Sam Leffler |
@@ -23,6 +23,7 @@ |
* LIABILITY, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE |
* OF THIS SOFTWARE. |
*/ |
+ |
#include "tiffiop.h" |
#ifdef CCITT_SUPPORT |
/* |
@@ -369,7 +370,7 @@ _TIFFFax3fillruns(unsigned char* buf, uint32* runs, uint32* erun, uint32 lastx) |
static const unsigned char _fillmasks[] = |
{ 0x00, 0x80, 0xc0, 0xe0, 0xf0, 0xf8, 0xfc, 0xfe, 0xff }; |
unsigned char* cp; |
- uint32 x, bx, run,bx_;/* add bx_ = 8-bx for avoid ms evc compiler bug*/ |
+ uint32 x, bx, run; |
int32 n, nw; |
long* lp; |
@@ -383,18 +384,10 @@ _TIFFFax3fillruns(unsigned char* buf, uint32* runs, uint32* erun, uint32 lastx) |
if (run) { |
cp = buf + (x>>3); |
bx = x&7; |
-// if (run > 8-bx) { |
-// if (bx) { /* align to byte boundary */ |
-// *cp++ &= 0xff << (8-bx); |
-// run -= 8-bx; |
-// } |
-//Modify by Sunliang.Liu 20090804 |
-//Detail: For avoid ms evc compiler bug in WCE ARMV4(I) Release |
- bx_ = 8-bx; |
- if (run > bx_) { |
+ if (run > 8-bx) { |
if (bx) { /* align to byte boundary */ |
- *cp++ &= 0xff << bx_; |
- run -= bx_; |
+ *cp++ &= 0xff << (8-bx); |
+ run -= 8-bx; |
} |
if( (n = run >> 3) != 0 ) { /* multiple bytes to fill */ |
if ((n/sizeof (long)) > 1) { |
@@ -411,9 +404,6 @@ _TIFFFax3fillruns(unsigned char* buf, uint32* runs, uint32* erun, uint32 lastx) |
} while (--nw); |
cp = (unsigned char*) lp; |
} |
-#ifdef FAX3_DEBUG |
- printf("_TIFFFax3fillruns ZERO: %d\n",n); |
-#endif |
ZERO(n, cp); |
run &= 7; |
} |
@@ -449,14 +439,12 @@ _TIFFFax3fillruns(unsigned char* buf, uint32* runs, uint32* erun, uint32 lastx) |
} while (--nw); |
cp = (unsigned char*) lp; |
} |
-#ifdef FAX3_DEBUG |
- printf("_TIFFFax3fillruns FILL: %d\n",n); |
-#endif |
FILL(n, cp); |
run &= 7; |
} |
+ /* Explicit 0xff masking to make icc -check=conversions happy */ |
if (run) |
- cp[0] |= 0xff00 >> run; |
+ cp[0] = (unsigned char)((cp[0] | (0xff00 >> run))&0xff); |
} else |
cp[0] |= _fillmasks[run]>>bx; |
x += runs[1]; |
@@ -1393,11 +1381,7 @@ TIFFInitCCITTFax3(TIFF* tif, int scheme) |
static int |
Fax4Decode(TIFF* tif, uint8* buf, tmsize_t occ, uint16 s) |
{ |
-#ifdef FAX3_DEBUG |
- FILE* file; |
-#endif |
DECLARE_STATE_2D(tif, sp, "Fax4Decode"); |
- |
(void) s; |
if (occ % sp->b.rowbytes) |
{ |
@@ -1420,11 +1404,6 @@ Fax4Decode(TIFF* tif, uint8* buf, tmsize_t occ, uint16 s) |
if (EOLcnt) |
goto EOFG4; |
(*sp->fill)(buf, thisrun, pa, lastx); |
-#ifdef FAX3_DEBUG |
- file = fopen("fillbuf.txt", "a"); |
- fwrite(buf, sp->b.rowbytes, 1, file); |
- fclose(file); |
-#endif |
SETVALUE(0); /* imaginary change for reference */ |
SWAP(uint32*, sp->curruns, sp->refruns); |
buf += sp->b.rowbytes; |
@@ -1440,11 +1419,6 @@ Fax4Decode(TIFF* tif, uint8* buf, tmsize_t occ, uint16 s) |
#endif |
ClrBits( 13 ); |
(*sp->fill)(buf, thisrun, pa, lastx); |
-#ifdef FAX3_DEBUG |
- file = fopen("fillbuf.txt", "a"); |
- fwrite(buf, sp->b.rowbytes, 1, file); |
- fclose(file); |
-#endif |
UNCACHE_STATE(tif, sp); |
return ( sp->line ? 1 : -1); /* don't error on badly-terminated strips */ |
} |
@@ -1620,4 +1594,3 @@ TIFFInitCCITTRLEW(TIFF* tif, int scheme) |
* fill-column: 78 |
* End: |
*/ |
- |