From 88665ea1f93408fd71790920750e0fc41841e416 Mon Sep 17 00:00:00 2001 From: Igor Melichev Date: Tue, 25 Nov 2003 15:32:29 +0000 Subject: 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 --- gs/src/gdevpsdi.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'gs/src') 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 || -- cgit v1.2.3