Commits

Chris Reuter committed 723ea52

Fix for Issue #97: segfaults when scaling a non-truecolor image

gdImageScaleTwoPass() now converts palette sources to truecolor before
scaling. This is consistent with the behaviour of the other scale
functions.

Comments (0)

Files changed (1)

src/gd_interpolation.c

         return gdImageClone(src);
     }/* if */
 
+	/* Convert to truecolor if it isn't; this code requires it. */
+	if (!src->trueColor) {
+		gdImagePaletteToTrueColor(src);
+	}/* if */
+
     /* Scale horizontally unless sizes are the same. */
     if (src_width == new_width) {
         tmp_im = src;