Package: largetifftools
Version: 1.4.1-1

Dear authors,

There exists a potential division by zero in project largetifftools
In computeMaxPieceMemorySize function in tiffmakemosaic.c,

678     *hnpieces = (inimagewidth+outpiecewidth-1) /
outpiecewidth;679       *vnpieces = (inimagelength+outpiecelength-1) /
outpiecelength;

When an arbitrary input is given in makeMosaicFromTIFFFile function
as follow:

739 TIFFGetField(in, TIFFTAG_IMAGEWIDTH, &inimagewidth); 740
 TIFFGetField(in, TIFFTAG_IMAGELENGTH, &inimagelength);

Possible fix would be checking if the denominators are not zero.
For example, adding the following if-guard at computeMaxPieceMemorySize
function

if (outpiecewidth == 0 || outpiecelength) {
   fprintf(stderr, "division-by-zero at ...", ...);
   return;
}

Thank you
Best regards
Changgong Lee

Reply via email to