summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBob Friesenhahn <bfriesen@simple.dallas.tx.us>2016-11-12 20:06:05 +0000
committerBob Friesenhahn <bfriesen@simple.dallas.tx.us>2016-11-12 20:06:05 +0000
commitc22e3e5b429efdfbd14d526c751b5c7632cef4fb (patch)
tree8f48e8679d575d5f00539b27cf916e3ab3a16151
parentb6779d1454ce5e5ea54fe16ce4ce74e0349745c3 (diff)
downloadlibtiff-git-c22e3e5b429efdfbd14d526c751b5c7632cef4fb.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);