GraphicsMagick: coders/wpg.c Shrink amount of colors when palett...

GraphicsMagick Commits <[email protected]>
Newsgroups gmane.comp.video.graphicsmagick.cvs
Message-ID <mailman.13153.1667604930.1459.graphicsmagick-commit@lists.sourceforge.net>
changeset 47dbc2c25234 in /hg/GraphicsMagick
details: http://hg.GraphicsMagick.org/hg/GraphicsMagick?cmd=changeset;node=47dbc2c25234
summary: coders/wpg.c Shrink amount of colors when palette is bigger than raster could store.

diffstat:

 ChangeLog    |  6 ++++++
 coders/wpg.c |  8 ++++----
 2 files changed, 10 insertions(+), 4 deletions(-)

diffs (50 lines):

diff -r bb6ff9f56aaf -r 47dbc2c25234 ChangeLog
--- a/ChangeLog	Thu Nov 03 19:22:02 2022 -0500
+++ b/ChangeLog	Sat Nov 05 00:34:57 2022 +0100
@@ -1,3 +1,9 @@
+2022-11-05 Fojtik Jaroslav  <[email protected]>
+
+        * coders/wpg.c Shrink amount of colors when palette is bigger than
+        raster could store.
+
+
 2022-11-03  Bob Friesenhahn  <[email protected]>
 
 	* magick/blob.c (ReadBlobString): Fix oss-fuzz issue 53001
diff -r bb6ff9f56aaf -r 47dbc2c25234 coders/wpg.c
--- a/coders/wpg.c	Thu Nov 03 19:22:02 2022 -0500
+++ b/coders/wpg.c	Sat Nov 05 00:34:57 2022 +0100
@@ -1,5 +1,5 @@
 /*
-% Copyright (C) 2003-2021 GraphicsMagick Group
+% Copyright (C) 2003-2022 GraphicsMagick Group
 % Copyright (C) 2002 ImageMagick Studio
 %
 % This program is covered by multiple licenses, which are described in
@@ -21,7 +21,7 @@
 %                                                                             %
 %                              Software Design                                %
 %                              Jaroslav Fojtik                                %
-%                              June 2000 - 2021                               %
+%                              June 2000 - 2022                               %
 %                         Rework for GraphicsMagick                           %
 %                              Bob Friesenhahn                                %
 %                               Feb-May 2003                                  %
@@ -1388,7 +1388,7 @@
               else
                 {
                   if (bpp < 24)
-                    if ( (image->colors < (1UL<<bpp)) && (bpp != 24) )
+                    if ( (image->colors != (1UL<<bpp)) && (bpp != 24) )
                       if (!ReallocColormap(image,1U<<bpp))
                         goto NoMemory;
                 }
@@ -1590,7 +1590,7 @@
               else
                 {
                   if(bpp < 24)
-                    if( image->colors<(1UL<<bpp) && bpp!=24 )
+                    if(image->colors!=(1UL<<bpp) && bpp!=24)
                       if (!ReallocColormap(image,1U<<bpp))
                         goto NoMemory;
                 }
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.