(LogLuvEncodeTile): Fix Coverity 991241 "Division or modulo by

zero".
This commit is contained in:
Bob Friesenhahn 2015-05-31 21:24:44 +00:00
parent a1beead1ef
commit 7d7b3db270
2 changed files with 6 additions and 1 deletions

View File

@ -6,6 +6,8 @@
zero".
(LogLuvEncodeStrip): Fix Coverity 991240 "Division or modulo by
zero".
(LogLuvEncodeTile): Fix Coverity 991241 "Division or modulo by
zero".
* libtiff/tif_dirread.c (TIFFReadDirEntryDoubleArray): Fix
Coverity 298626 "Logically dead code".

View File

@ -1,4 +1,4 @@
/* $Id: tif_luv.c,v 1.38 2015-05-31 21:23:23 bfriesen Exp $ */
/* $Id: tif_luv.c,v 1.39 2015-05-31 21:24:44 bfriesen Exp $ */
/*
* Copyright (c) 1997 Greg Ward Larson
@ -668,6 +668,9 @@ LogLuvEncodeTile(TIFF* tif, uint8* bp, tmsize_t cc, uint16 s)
{
tmsize_t rowlen = TIFFTileRowSize(tif);
if (rowlen == 0)
return 0;
assert(cc%rowlen == 0);
while (cc && (*tif->tif_encoderow)(tif, bp, rowlen, s) == 1)
bp += rowlen, cc -= rowlen;