Commits

Pierre Joye committed 706c0da Merge

Merge branch 'master' of https://bitbucket.org/libgd/gd-libgd

Comments (0)

Files changed (5)

 OPTION(ENABLE_TIFF "Enable TIFF support" 0)
 OPTION(ENABLE_XPM "Enable XPM support" 0)
 OPTION(ENABLE_FREETYPE "Enable Freetype2 support" 0)
-OPTION(ENABLE_WBMP "Enable WBMP support" 0)
 OPTION(ENABLE_FONTCONFIG "Enable FontConfig support" 0)
 OPTION(ENABLE_WEBP "Enable WebP support" 0)
 
 };
 
 /* max depth of stack */
-#define FILL_MAX 1200000
+#define FILL_MAX ((int)(im->sy*im->sx)/4)
 #define FILL_PUSH(Y, XL, XR, DY) \
-    if (sp<stack+FILL_MAX*10 && Y+(DY)>=0 && Y+(DY)<wy2) \
+    if (sp<stack+FILL_MAX && Y+(DY)>=0 && Y+(DY)<wy2) \
     {sp->y = Y; sp->xl = XL; sp->xr = XR; sp->dy = DY; sp++;}
 
 #define FILL_POP(Y, XL, XR, DY) \
 			double sx, sy;
 			double spixels = 0;
 			double red = 0.0, green = 0.0, blue = 0.0, alpha = 0.0;
-			double alpha_factor, alpha_sum = 0.0, contrib_sum = 0.0;
+			double alpha_sum = 0.0, contrib_sum = 0.0;
 
 			sx1 = ((double) x - (double) dstX) * (double) srcW / dstW;
 			sx2 = ((double) (x + 1) - (double) dstX) * (double) srcW / dstW;
 BGD_DECLARE(int) gdImagePaletteToTrueColor(gdImagePtr src)
 {
 	unsigned int y;
-	unsigned char alloc_y = 0, alloc_aa = 0;
 	unsigned int yy;
 
 	if (src == NULL) {
 #else /* no HAVE_LIBPNG */
 BGD_DECLARE(void) gdImagePngToSink (gdImagePtr im, gdSinkPtr outSink)
 {
+	(void)im;
+	(void)outSink;
 	fprintf (stderr, "PNG support is not available\n");
 }
 
 BGD_DECLARE(gdImagePtr) gdImageCreateFromPngSource (gdSourcePtr inSource)
 {
+	(void)inSource;
 	fprintf (stderr, "PNG support is not available\n");
 	return NULL;
 }
 /* number of antialised colors for indexed bitmaps */
 #define GD_NUMCOLORS 8
 
+#ifdef HAVE_LIBFONTCONFIG
 static int fontConfigFlag = 0;
 
-static char *font_path(char **fontpath, char *name_list);
 /* translate a fontconfig fontpattern into a fontpath.
 	return NULL if OK, else return error string */
 static char *font_pattern(char **fontpath, char *fontpattern);
+#endif
+
+static char *font_path(char **fontpath, char *name_list);
 
 /* 2.0.30: move these up here so we can build correctly without freetype
 	but with fontconfig */
 	fontConfigFlag = flag;
 	return 1;
 #else
+	(void)flag;
 	return 0;
 #endif /* HAVE_LIBFONTCONFIG */
 }
 	err =
 	    gdImageStringFT ((gdImagePtr) NULL, &brect[0], 0, f, sz, angle, 0, 0, s);
 	if (err) {
-		fprintf (stderr, err);
+		fprintf (stderr, "%s\n", err);
 		return 1;
 	}
 
 	/* With antialiasing (positive color value) */
 	err = gdImageStringFT (im, NULL, blue, f, sz, angle, x, y, s);
 	if (err) {
-		fprintf (stderr, err);
+		fprintf (stderr, "%s\n", err);
 		return 1;
 	}
 	/* Without antialiasing (negative color value) */
 	err = gdImageStringFT (im, NULL, -blue, f, sz, angle, sx + x, y, s);
 	if (err) {
-		fprintf (stderr, err);
+		fprintf (stderr, "%s\n", err);
 		return 1;
 	}
 	/* With antialiasing, and 50% alpha blending (truecolor only) */
 	err = gdImageStringFT (im, NULL, blueAlpha, f, sz, angle, sx * 2 + x, y, s);
 	if (err) {
-		fprintf (stderr, err);
+		fprintf (stderr, "%s\n", err);
 		return 1;
 	}
 	/* TBB: Write img to test/fttest.jpg or test/fttest.png */