From e57c4dcd714b74ff84d5817197e80ca5d0fcff3e Mon Sep 17 00:00:00 2001 From: steven_carr Date: Tue, 2 May 2006 20:50:28 +0000 Subject: CopyRectangle() BPP!=8 bug fixed --- libvncclient/rfbproto.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libvncclient/rfbproto.c') diff --git a/libvncclient/rfbproto.c b/libvncclient/rfbproto.c index 3a29e53..b7d6a75 100644 --- a/libvncclient/rfbproto.c +++ b/libvncclient/rfbproto.c @@ -143,7 +143,7 @@ static void CopyRectangle(rfbClient* client, uint8_t* buffer, int x, int y, int #define COPY_RECT(BPP) \ { \ int rs = w * BPP / 8, rs2 = client->width * BPP / 8; \ - for (j = x + y * rs2; j < (y + h) * rs2; j += rs2) { \ + for (j = ((x * (BPP / 8)) + (y * rs2)); j < (y + h) * rs2; j += rs2) { \ memcpy(client->frameBuffer + j, buffer, rs); \ buffer += rs; \ } \ -- cgit v1.2.1