--- a/scintilla/src/XPM.cxx
+++ b/scintilla/src/XPM.cxx
@@ -319,8 +319,8 @@
 	return (width > 0) ? width : 0;
 }
 
-RGBAImage::RGBAImage(int width_, int height_, const unsigned char *pixels_) :
-	height(height_), width(width_) {
+RGBAImage::RGBAImage(int width_, int height_, float scale_, const unsigned char *pixels_) :
+	height(height_), width(width_), scale(scale_) {
 	if (pixels_) {
 		pixelBytes.assign(pixels_, pixels_ + CountBytes());
 	} else {
@@ -331,6 +331,7 @@
 RGBAImage::RGBAImage(const XPM &xpm) {
 	height = xpm.GetHeight();
 	width = xpm.GetWidth();
+	scale = 1;
 	pixelBytes.resize(CountBytes());
 	for (int y=0; y<height; y++) {
 		for (int x=0; x<width; x++) {
@@ -356,10 +357,10 @@
 void RGBAImage::SetPixel(int x, int y, ColourDesired colour, int alpha) {
 	unsigned char *pixel = &pixelBytes[0] + (y*width+x) * 4;
 	// RGBA
-	pixel[0] = colour.GetRed();
-	pixel[1] = colour.GetGreen();
-	pixel[2] = colour.GetBlue();
-	pixel[3] = alpha;
+	pixel[0] = static_cast<unsigned char>(colour.GetRed());
+	pixel[1] = static_cast<unsigned char>(colour.GetGreen());
+	pixel[2] = static_cast<unsigned char>(colour.GetBlue());
+	pixel[3] = static_cast<unsigned char>(alpha);
 }
 
 RGBAImageSet::RGBAImageSet() : height(-1), width(-1){