diff options
author | bfriesen <bfriesen> | 2015-05-31 21:21:22 +0000 |
---|---|---|
committer | bfriesen <bfriesen> | 2015-05-31 21:21:22 +0000 |
commit | d3d09813e5f731620ef36b4f355c8ead41a61bfe (patch) | |
tree | d396aa7abc81a7559bae98d2025357ff81f793bb | |
parent | a5e75a1673bb19db0af57753303fcb244ec30d81 (diff) | |
download | libtiff-d3d09813e5f731620ef36b4f355c8ead41a61bfe.tar.gz |
(LogLuvDecodeStrip): Fix Coverity 991239 "Division or modulo by
zero".
-rw-r--r-- | ChangeLog | 2 | ||||
-rw-r--r-- | libtiff/tif_luv.c | 5 |
2 files changed, 6 insertions, 1 deletions
@@ -2,6 +2,8 @@ * libtiff/tif_luv.c (LogLuvDecodeTile): Fix Coverity 991227 "Division or modulo by zero". + (LogLuvDecodeStrip): Fix Coverity 991239 "Division or modulo by + zero". * libtiff/tif_dirread.c (TIFFReadDirEntryDoubleArray): Fix Coverity 298626 "Logically dead code". diff --git a/libtiff/tif_luv.c b/libtiff/tif_luv.c index e462d628..2f746127 100644 --- a/libtiff/tif_luv.c +++ b/libtiff/tif_luv.c @@ -1,4 +1,4 @@ -/* $Id: tif_luv.c,v 1.36 2015-05-31 21:19:07 bfriesen Exp $ */ +/* $Id: tif_luv.c,v 1.37 2015-05-31 21:21:23 bfriesen Exp $ */ /* * Copyright (c) 1997 Greg Ward Larson @@ -379,6 +379,9 @@ LogLuvDecodeStrip(TIFF* tif, uint8* bp, tmsize_t cc, uint16 s) { tmsize_t rowlen = TIFFScanlineSize(tif); + if (rowlen == 0) + return 0; + assert(cc%rowlen == 0); while (cc && (*tif->tif_decoderow)(tif, bp, rowlen, s)) bp += rowlen, cc -= rowlen; |