diff options
author | Marcos H. Woehrmann <marcos.woehrmann@artifex.com> | 2012-03-05 19:21:53 -0800 |
---|---|---|
committer | Chris Liddell <chris.liddell@artifex.com> | 2012-03-15 11:54:24 +0000 |
commit | a17629a4f31f5397b86436d4afb42a8e0d66f419 (patch) | |
tree | 2bb51f97b03a468641d5e3fcfeab85cdf7c98261 | |
parent | 70f4e43b71e8a2d6e8f4e6e138c06d0df5a7d0c6 (diff) |
Fix detection of TIFF file size overflow in tiffsep.
The TIFF spec limits files to 4 Gigs. The code to detect attempts
to write files that were larger than this in gdevtsep.c was broken
on systems were a long != 32 bit.
Fixes Bug 692896.
-rw-r--r-- | gs/base/gdevtsep.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gs/base/gdevtsep.c b/gs/base/gdevtsep.c index 689a10fa2..6ed741c55 100644 --- a/gs/base/gdevtsep.c +++ b/gs/base/gdevtsep.c @@ -1582,7 +1582,7 @@ tiffsep_print_page(gx_device_printer * pdev, FILE * file) /* Write the page directory for the CMYK equivalent file. */ pdev->color_info.depth = 32; /* Create directory for 32 bit cmyk */ - if (pdev->height > (max_long - ftell(file))/(pdev->width*4)) /* note width is never 0 in print_page */ + if (pdev->height > ((long) 0xFFFFFFFF - ftell(file))/(pdev->width*4)) /* note width is never 0 in print_page */ { dprintf("CMYK composite file would be too large! Reduce resolution.\n"); return_error(gs_error_rangecheck); /* this will overflow max_long */ |