--- a/tiff-4.0.6/libtiff/tif_pixarlog.c 2015-08-28 15:16:22.630733000 -0700 +++ b/tiff-4.0.6/libtiff/tif_pixarlog.c 2016-10-12 15:20:17.910232402 -0700 @@ -1131,6 +1131,14 @@ } llen = sp->stride * td->td_imagewidth; + + /* Check against the number of elements (of size uint16) of sp->tbuf */ + if( n > td->td_rowsperstrip * llen ) + { + TIFFErrorExt(tif->tif_clientdata, module, + "Too many input bytes provided"); + return 0; + } for (i = 0, up = sp->tbuf; i < n; i += llen, up += llen) { switch (sp->user_datafmt) {