summaryrefslogtreecommitdiff
path: root/src/gd_topal.c
diff options
context:
space:
mode:
authorpierre <none@none>2006-04-05 15:52:22 +0000
committerpierre <none@none>2006-04-05 15:52:22 +0000
commitb77f755a6411d540172454e838cc9cbecd12d168 (patch)
tree07d0c95ba4f65deefd443df35a2d5db981f679b3 /src/gd_topal.c
parentb7edc0573cb9dd6e8a3c219517431944aaf20153 (diff)
downloadlibgd-b77f755a6411d540172454e838cc9cbecd12d168.tar.gz
- sync to 2.0.24
Diffstat (limited to 'src/gd_topal.c')
-rw-r--r--src/gd_topal.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/gd_topal.c b/src/gd_topal.c
index 6092506..31c9cb8 100644
--- a/src/gd_topal.c
+++ b/src/gd_topal.c
@@ -1316,7 +1316,11 @@ pass2_no_dither (j_decompress_ptr cinfo,
#else
r = gdTrueColorGetRed (*inptr);
g = gdTrueColorGetGreen (*inptr);
- b = gdTrueColorGetBlue (*inptr++);
+ /*
+ 2.0.24: inptr must not be incremented until after
+ transparency check, if any. Thanks to "Super Pikeman."
+ */
+ b = gdTrueColorGetBlue (*inptr);
/* If the pixel is transparent, we assign it the palette index that
* will later be added at the end of the palette as the transparent
@@ -1324,8 +1328,10 @@ pass2_no_dither (j_decompress_ptr cinfo,
if ((im->transparent >= 0) && (im->transparent == *inptr))
{
*outptr++ = im->colorsTotal;
+ inptr++;
continue;
}
+ inptr++;
#endif
c0 = r >> C0_SHIFT;
c1 = g >> C1_SHIFT;
@@ -1752,8 +1758,7 @@ zeroHistogram (hist3d histogram)
GLOBAL (void)
jinit_2pass_quantizer (j_decompress_ptr cinfo)
#else
-void
-gdImageTrueColorToPalette (gdImagePtr im, int dither, int colorsWanted)
+BGD_DECLARE(void) gdImageTrueColorToPalette (gdImagePtr im, int dither, int colorsWanted)
#endif
{
my_cquantize_ptr cquantize = NULL;