[gs-commits] ghostpdl branch, master, updated. jbig2dec-0.14-1587-g390867f

[email protected] (Robin Watts)
Newsgroups gmane.comp.printing.ghostscript.cvs
Message-ID <[email protected]>
The ghostpdl branch, master has been updated
       via  390867f19f49a52d4585c0e5e980b2c245e15e76 (commit)
      from  885444fcbe10dc42787ecb76686c8ee4dd33bf33 (commit)

----------------------------------------------------------------------
commit 390867f19f49a52d4585c0e5e980b2c245e15e76
Author: Robin Watts <[email protected]>
Date:   Tue Aug 20 12:24:03 2019 +0100

    Fix overflow in deep color blending.
    
    Multiplying a 16bit unsigned value with a 16 bit signed value
    in a 32bit int means we lose the sign bit. Sacrifice a bit of
    accuracy to avoid that.

diff --git a/base/gxblend.c b/base/gxblend.c
index 0e29fc9..aaadca8 100644
--- a/base/gxblend.c
+++ b/base/gxblend.c
@@ -1934,6 +1934,8 @@ art_pdf_composite_pixel_alpha_16_inline(uint16_t *gs_restrict dst, uint16_t *gs_
                 dst[i] += (src_scale * (blend[i] - dst[i]) + 0x8000) >> 16;
             }
         } else {
+            int a_b2 = a_b>>1;
+            int ss2 = src_scale>>1;
             for (i = 0; i < first_spot; i++) {
                 int c_bl;		/* Result of blend function */
 
@@ -1941,8 +1943,8 @@ art_pdf_composite_pixel_alpha_16_inline(uint16_t *gs_restrict dst, uint16_t *gs_
                 c_b = dst[i];
                 c_bl = blend[i];
 
-                c_s += (a_b * (c_bl - c_s) + 0x8000) >> 16;
-                c_b += (src_scale * (c_s - c_b) + 0x8000) >> 16;
+                c_s += (a_b2 * (c_bl - c_s) + 0x4000) >> 15;
+                c_b += (ss2 * (c_s - c_b) + 0x4000) >> 15;
                 dst[i] = c_b;
             }
         }
diff --git a/windows/GhostPDL.sln b/windows/GhostPDL.sln
index e75e70b..b1463c3 100644
--- a/windows/GhostPDL.sln
+++ b/windows/GhostPDL.sln
@@ -1,15 +1,17 @@
 
-Microsoft Visual Studio Solution File, Format Version 9.00
-# Visual Studio 2005
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ghostscript", "ghostscript.vcproj", "{1EDA2AC3-D74F-4F4D-B4D6-AC05CC594A2F}"
+Microsoft Visual Studio Solution File, Format Version 12.00
+# Visual Studio 15
+VisualStudioVersion = 15.0.28307.757
+MinimumVisualStudioVersion = 10.0.40219.1
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ghostscript", "ghostscript.vcxproj", "{1EDA2AC3-D74F-4F4D-B4D6-AC05CC594A2F}"
 EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ghostpcl", "ghostpcl.vcproj", "{ED35CF95-DAA1-45B3-9206-599F4170F198}"
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ghostpcl", "ghostpcl.vcxproj", "{ED35CF95-DAA1-45B3-9206-599F4170F198}"
 EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ghostxps", "ghostxps.vcproj", "{DE21942C-CDA2-445B-B2EC-51FF54E0F0DD}"
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ghostxps", "ghostxps.vcxproj", "{DE21942C-CDA2-445B-B2EC-51FF54E0F0DD}"
 EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ghostpdl", "ghostpdl.vcproj", "{C4038125-61B9-4147-9EA8-39690BA3A599}"
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "ghostpdl", "ghostpdl.vcxproj", "{C4038125-61B9-4147-9EA8-39690BA3A599}"
 EndProject
-Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "All", "All.vcproj", "{98351FEF-0032-457C-B9D9-D6B68A829386}"
+Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "All", "All.vcxproj", "{98351FEF-0032-457C-B9D9-D6B68A829386}"
 EndProject
 Global
 	GlobalSection(SolutionConfigurationPlatforms) = preSolution
@@ -135,4 +137,7 @@ Global
 	GlobalSection(SolutionProperties) = preSolution
 		HideSolutionNode = FALSE
 	EndGlobalSection
+	GlobalSection(ExtensibilityGlobals) = postSolution
+		SolutionGuid = {C798B83F-2CED-4C94-9DAD-6C2158D38B30}
+	EndGlobalSection
 EndGlobal


Summary of changes:
 base/gxblend.c       |  6 ++++--
 windows/GhostPDL.sln | 19 ++++++++++++-------
 2 files changed, 16 insertions(+), 9 deletions(-)
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.