fix vips image writes of more than 2gb

With very wide images and huge numbers of threads, it was possible to
trigger an int overflow in write_vips().

Thanks @erdmann

See https://github.com/libvips/libvips/issues/1306
This commit is contained in:
John Cupitt 2019-05-07 13:56:52 +01:00
parent bcdaeca578
commit 3921e63561

View File

@ -635,7 +635,7 @@ write_vips( VipsRegion *region, VipsRect *area, void *a, void *b )
size_t nwritten, count; size_t nwritten, count;
void *buf; void *buf;
count = region->bpl * area->height; count = (size_t) region->bpl * area->height;
buf = VIPS_REGION_ADDR( region, 0, area->top ); buf = VIPS_REGION_ADDR( region, 0, area->top );
do { do {