summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbfriesen <bfriesen>2016-11-12 20:06:05 +0000
committerbfriesen <bfriesen>2016-11-12 20:06:05 +0000
commit0f66b0034f0bac33b72ca446057c21130d99fa49 (patch)
treede7454cd2d54910038c6ad1983901d1591ba35eb
parent1d634c3f002c4a6ea8467811da38d20841a2e050 (diff)
downloadlibtiff-0f66b0034f0bac33b72ca446057c21130d99fa49.tar.gz
* tools/tiffinfo.c (TIFFReadContigTileData): Fix signed/unsigned
comparison warning. (TIFFReadSeparateTileData): Fix signed/unsigned comparison warning.
-rw-r--r--ChangeLog5
-rw-r--r--tools/tiffinfo.c12
2 files changed, 11 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index 1af18a1a..89300013 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
2016-11-12 Bob Friesenhahn <bfriesen@simple.dallas.tx.us>
+ * tools/tiffinfo.c (TIFFReadContigTileData): Fix signed/unsigned
+ comparison warning.
+ (TIFFReadSeparateTileData): Fix signed/unsigned comparison
+ warning.
+
* tools/tiffcrop.c (readContigTilesIntoBuffer): Fix
signed/unsigned comparison warning.
diff --git a/tools/tiffinfo.c b/tools/tiffinfo.c
index fad7404e..b02c7d46 100644
--- a/tools/tiffinfo.c
+++ b/tools/tiffinfo.c
@@ -1,4 +1,4 @@
-/* $Id: tiffinfo.c,v 1.24 2016-10-25 20:04:22 erouault Exp $ */
+/* $Id: tiffinfo.c,v 1.25 2016-11-12 20:06:05 bfriesen Exp $ */
/*
* Copyright (c) 1988-1997 Sam Leffler
@@ -295,7 +295,7 @@ TIFFReadContigTileData(TIFF* tif)
{
unsigned char *buf;
tmsize_t rowsize = TIFFTileRowSize(tif);
- tmsize_t tilesize = TIFFTileSize(tif);
+ tmsize_t tilesize = TIFFTileSize(tif);
buf = (unsigned char *)_TIFFmalloc(tilesize);
if (buf) {
@@ -306,7 +306,7 @@ TIFFReadContigTileData(TIFF* tif)
TIFFGetField(tif, TIFFTAG_IMAGELENGTH, &h);
TIFFGetField(tif, TIFFTAG_TILEWIDTH, &tw);
TIFFGetField(tif, TIFFTAG_TILELENGTH, &th);
- if( rowsize == 0 || th > tilesize / rowsize )
+ if ( rowsize == 0 || th > (size_t) (tilesize / rowsize) )
{
fprintf(stderr, "Cannot display data: th * rowsize > tilesize\n");
_TIFFfree(buf);
@@ -329,8 +329,8 @@ void
TIFFReadSeparateTileData(TIFF* tif)
{
unsigned char *buf;
- tmsize_t rowsize = TIFFTileRowSize(tif);
- tmsize_t tilesize = TIFFTileSize(tif);
+ tmsize_t rowsize = TIFFTileRowSize(tif);
+ tmsize_t tilesize = TIFFTileSize(tif);
buf = (unsigned char *)_TIFFmalloc(tilesize);
if (buf) {
@@ -343,7 +343,7 @@ TIFFReadSeparateTileData(TIFF* tif)
TIFFGetField(tif, TIFFTAG_TILEWIDTH, &tw);
TIFFGetField(tif, TIFFTAG_TILELENGTH, &th);
TIFFGetField(tif, TIFFTAG_SAMPLESPERPIXEL, &samplesperpixel);
- if( rowsize == 0 || th > tilesize / rowsize )
+ if ( rowsize == 0 || th > (size_t) (tilesize / rowsize) )
{
fprintf(stderr, "Cannot display data: th * rowsize > tilesize\n");
_TIFFfree(buf);