summaryrefslogtreecommitdiffstats
path: root/libvncclient
diff options
context:
space:
mode:
authorsteven_carr <steven_carr>2006-05-02 20:50:28 +0000
committersteven_carr <steven_carr>2006-05-02 20:50:28 +0000
commite57c4dcd714b74ff84d5817197e80ca5d0fcff3e (patch)
tree888a8e21b6ec4053394cf5e1661c67f83b793429 /libvncclient
parent18cd366896b7e0f3ce31b1c042dbb19b634fe16d (diff)
downloadlibtdevnc-e57c4dcd714b74ff84d5817197e80ca5d0fcff3e.tar.gz
libtdevnc-e57c4dcd714b74ff84d5817197e80ca5d0fcff3e.zip
CopyRectangle() BPP!=8 bug fixed
Diffstat (limited to 'libvncclient')
-rw-r--r--libvncclient/rfbproto.c2
1 files changed, 1 insertions, 1 deletions
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; \
} \