diff options
author | Igor Melichev <igor.melichev@artifex.com> | 2003-11-25 15:32:29 +0000 |
---|---|---|
committer | Igor Melichev <igor.melichev@artifex.com> | 2003-11-25 15:32:29 +0000 |
commit | 88665ea1f93408fd71790920750e0fc41841e416 (patch) | |
tree | a58d330d0bfd4f6114bb46fa64e9b74513ebe8c4 /gs/src/gdevpsdi.c | |
parent | 59614456c60950cf01506ebd49012012bd26d442 (diff) |
Fix (pdfwrite) : A fixed overflow in setup_image_compression.
DETAILS :
Bug 687164 "(pdfwrite) dina3_watermark.pdf generates a 293Meg PDF".
The bug persists since Sun Apr 30 01:26:41 2000 UTC.
EXPECTED DIFFERENCES :
The re-distilled dina3_watermark.pdf renders differently due to DCT compression applied.
git-svn-id: http://svn.ghostscript.com/ghostscript/trunk@4392 a1074d23-0009-0410-80fe-cf8c14f379e6
Diffstat (limited to 'gs/src/gdevpsdi.c')
-rw-r--r-- | gs/src/gdevpsdi.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/gs/src/gdevpsdi.c b/gs/src/gdevpsdi.c index 5266da8be..63a3c1d90 100644 --- a/gs/src/gdevpsdi.c +++ b/gs/src/gdevpsdi.c @@ -125,8 +125,9 @@ setup_image_compression(psdf_binary_writer *pbw, const psdf_image_params *pdip, gs_c_param_list_read(dict); /* ensure param list is in read mode */ if (template == 0) /* no compression */ return 0; - if (pim->Width * pim->Height * Colors * pim->BitsPerComponent <= 160) /* not worth compressing */ - return 0; + if (pim->Width < 200 && pim->Height < 200) /* Prevent a fixed overflow. */ + if (pim->Width * pim->Height * Colors * pim->BitsPerComponent <= 160) + return 0; /* not worth compressing */ /* Only use DCTE for 8-bit, non-Indexed data. */ if (template == &s_DCTE_template) { if (Indexed || |