[sane-devel] Small xscanimage bug
Thu, 17 Jul 2003 07:17:43 +0200
Gerard Klaver reported a small bug in xscanimage (and quiteinsane). I don't
know, whether he also informed the xscanimage maintainer, therefore I report
it on sane-devel.
The size of huge images gets displayed incorrectly. For instance, the size
of a 27192 x 37439 image in 8bit RGB mode is reported as 1185,07 Mbyte.
Cast ints to double before multiplication.
In xscanimage.c around line 464 change
double size = params.bytes_per_line * params.lines;
double size = (double)params.bytes_per_line * (double)params.lines;
otherwise multiplying two ints might exceed INT_MAX.