diff --git a/ChangeLog b/ChangeLog index 55e04600..26dba457 100644 --- a/ChangeLog +++ b/ChangeLog @@ -4,6 +4,8 @@ "Division or modulo by zero". (TIFFWriteEncodedTile): Fix Coverity 715976 and 715977 "Division or modulo by zero". + (TIFFWriteRawStrip): Fix Coverity 715978 "Division or modulo by + zero". * libtiff/tif_read.c (TIFFStartTile): Fix Coverity 715973 and 715974 "Division or modulo by zero". diff --git a/libtiff/tif_write.c b/libtiff/tif_write.c index e4cf6c47..e84c879a 100644 --- a/libtiff/tif_write.c +++ b/libtiff/tif_write.c @@ -1,4 +1,4 @@ -/* $Id: tif_write.c,v 1.40 2015-06-07 22:47:29 bfriesen Exp $ */ +/* $Id: tif_write.c,v 1.41 2015-06-07 22:53:17 bfriesen Exp $ */ /* * Copyright (c) 1988-1997 Sam Leffler @@ -316,6 +316,10 @@ TIFFWriteRawStrip(TIFF* tif, uint32 strip, void* data, tmsize_t cc) return ((tmsize_t) -1); } tif->tif_curstrip = strip; + if (td->td_stripsperimage == 0) { + TIFFErrorExt(tif->tif_clientdata, module,"Zero strips per image"); + return ((tmsize_t) -1); + } tif->tif_row = (strip % td->td_stripsperimage) * td->td_rowsperstrip; return (TIFFAppendToStrip(tif, strip, (uint8*) data, cc) ? cc : (tmsize_t) -1);