summaryrefslogtreecommitdiff
path: root/libtiff
diff options
context:
space:
mode:
authorBob Friesenhahn <bfriesen@simple.dallas.tx.us>2015-05-31 20:57:56 +0000
committerBob Friesenhahn <bfriesen@simple.dallas.tx.us>2015-05-31 20:57:56 +0000
commitffe4f83100aae67341ecfe2711836f43dc476d29 (patch)
tree5ef473e3203a909e53b3a47afef32542972dab9a /libtiff
parent666ca03c6536467834a0135536c4d17714e3efad (diff)
downloadlibtiff-git-ffe4f83100aae67341ecfe2711836f43dc476d29.tar.gz
* libtiff/tif_dir.c (TIFFNumberOfDirectories): Don't depend on ++
operator precedenc in evaluation. Might quench Coverity 1134470 "Logically dead code".
Diffstat (limited to 'libtiff')
-rw-r--r--libtiff/tif_dir.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/libtiff/tif_dir.c b/libtiff/tif_dir.c
index 17bf8782..6682361b 100644
--- a/libtiff/tif_dir.c
+++ b/libtiff/tif_dir.c
@@ -1,4 +1,4 @@
-/* $Id: tif_dir.c,v 1.119 2014-12-27 15:20:42 erouault Exp $ */
+/* $Id: tif_dir.c,v 1.120 2015-05-31 20:57:56 bfriesen Exp $ */
/*
* Copyright (c) 1988-1997 Sam Leffler
@@ -1486,7 +1486,8 @@ TIFFAdvanceDirectory(TIFF* tif, uint64* nextdir, uint64* off)
(void) TIFFSeekFile(tif,
dircount16*20, SEEK_CUR);
if (!ReadOK(tif, nextdir, sizeof (uint64))) {
- TIFFErrorExt(tif->tif_clientdata, module, "%s: Error fetching directory link",
+ TIFFErrorExt(tif->tif_clientdata, module,
+ "%s: Error fetching directory link",
tif->tif_name);
return (0);
}
@@ -1513,10 +1514,12 @@ TIFFNumberOfDirectories(TIFF* tif)
n = 0;
while (nextdir != 0 && TIFFAdvanceDirectory(tif, &nextdir, NULL))
{
- if(++n == 0)
+ ++n;
+ if (n == 0)
{
TIFFErrorExt(tif->tif_clientdata, module,
- "Directory count exceeded 65535 limit, giving up on counting.");
+ "Directory count exceeded 65535 limit,"
+ " giving up on counting.");
return (65535);
}
}