diff --git a/ChangeLog b/ChangeLog index 1de8f91f..ed0b1c7e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -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". diff --git a/libtiff/tif_luv.c b/libtiff/tif_luv.c index 37193742..d2952a8a 100644 --- a/libtiff/tif_luv.c +++ b/libtiff/tif_luv.c @@ -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;