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/rreDecode.h b/common/rfb/rreDecode.h
index 9dc0470..56defbd 100644
--- a/common/rfb/rreDecode.h
+++ b/common/rfb/rreDecode.h
@@ -41,7 +41,7 @@
{
int nSubrects = is->readU32();
PIXEL_T bg = is->READ_PIXEL();
- pb->fillRect(pf, r, bg);
+ pb->fillRect(pf, r, &bg);
for (int i = 0; i < nSubrects; i++) {
PIXEL_T pix = is->READ_PIXEL();
@@ -49,7 +49,7 @@
int y = is->readU16();
int w = is->readU16();
int h = is->readU16();
- pb->fillRect(pf, Rect(r.tl.x+x, r.tl.y+y, r.tl.x+x+w, r.tl.y+y+h), pix);
+ pb->fillRect(pf, Rect(r.tl.x+x, r.tl.y+y, r.tl.x+x+w, r.tl.y+y+h), &pix);
}
}