Change fillRect() to take a buffer instead of a pixel
There has been some confusion if fillRect() should accept a buffer
or a pixel. This can cause misrendering if your data is not in the
native endian order. A buffer makes more sense here though, and
is what most of the callers are already assuming, so change the
API to follow that.
diff --git a/common/rfb/Encoder.cxx b/common/rfb/Encoder.cxx
index 56b5f38..18b6680 100644
--- a/common/rfb/Encoder.cxx
+++ b/common/rfb/Encoder.cxx
@@ -38,13 +38,11 @@
const PixelFormat& pf, const rdr::U8* colour)
{
ManagedPixelBuffer buffer(pf, width, height);
- Pixel pixel;
Palette palette;
rdr::U32 palcol;
- pixel = pf.pixelFromBuffer(colour);
- buffer.fillRect(buffer.getRect(), pixel);
+ buffer.fillRect(buffer.getRect(), colour);
palcol = 0;
memcpy(&palcol, colour, pf.bpp/8);