diff options
author | bfriesen <bfriesen> | 2015-05-31 23:11:43 +0000 |
---|---|---|
committer | bfriesen <bfriesen> | 2015-05-31 23:11:43 +0000 |
commit | 118ae7bdaa885637b8cbef7b60436ac3d1e666a8 (patch) | |
tree | 92082db6f5b7b8fb3983343285c789c4ae8b7d46 | |
parent | 93ef48173a43bebe6d11d360620deac55cdce035 (diff) | |
download | libtiff-118ae7bdaa885637b8cbef7b60436ac3d1e666a8.tar.gz |
* libtiff/tif_dir.c (TIFFNumberOfDirectories): Quiet Coverity
1134470 "Logically dead code" by making the roll-over check
explicit.
-rw-r--r-- | ChangeLog | 4 | ||||
-rw-r--r-- | libtiff/tif_dir.c | 8 |
2 files changed, 9 insertions, 3 deletions
@@ -1,5 +1,9 @@ 2015-05-31 Bob Friesenhahn <bfriesen@simple.dallas.tx.us> + * libtiff/tif_dir.c (TIFFNumberOfDirectories): Quiet Coverity + 1134470 "Logically dead code" by making the roll-over check + explicit. + * libtiff/tif_luv.c (LogLuvDecodeTile): Fix Coverity 991227 "Division or modulo by zero". (LogLuvDecodeStrip): Fix Coverity 991239 "Division or modulo by diff --git a/libtiff/tif_dir.c b/libtiff/tif_dir.c index 6682361b..73212c02 100644 --- a/libtiff/tif_dir.c +++ b/libtiff/tif_dir.c @@ -1,4 +1,4 @@ -/* $Id: tif_dir.c,v 1.120 2015-05-31 20:57:56 bfriesen Exp $ */ +/* $Id: tif_dir.c,v 1.121 2015-05-31 23:11:43 bfriesen Exp $ */ /* * Copyright (c) 1988-1997 Sam Leffler @@ -1514,8 +1514,10 @@ TIFFNumberOfDirectories(TIFF* tif) n = 0; while (nextdir != 0 && TIFFAdvanceDirectory(tif, &nextdir, NULL)) { - ++n; - if (n == 0) + if (n != 65535) { + ++n; + } + else { TIFFErrorExt(tif->tif_clientdata, module, "Directory count exceeded 65535 limit," |