Merge pull request #99 from spaceone/master

Ignore null pointers in FillRectangle() and CopyRectangleFromRectangle()
pull/1/head
Christian Beier 8 years ago
commit 5b322f523f

@ -150,6 +150,10 @@ void* rfbClientGetClientData(rfbClient* client, void* tag)
static void FillRectangle(rfbClient* client, int x, int y, int w, int h, uint32_t colour) {
int i,j;
if (client->frameBuffer == NULL) {
return;
}
#define FILL_RECT(BPP) \
for(j=y*client->width;j<(y+h)*client->width;j+=client->width) \
for(i=x;i<x+w;i++) \
@ -193,6 +197,10 @@ static void CopyRectangle(rfbClient* client, uint8_t* buffer, int x, int y, int
static void CopyRectangleFromRectangle(rfbClient* client, int src_x, int src_y, int w, int h, int dest_x, int dest_y) {
int i,j;
if (client->frameBuffer == NULL) {
return;
}
#define COPY_RECT_FROM_RECT(BPP) \
{ \
uint##BPP##_t* _buffer=((uint##BPP##_t*)client->frameBuffer)+(src_y-dest_y)*client->width+src_x-dest_x; \

Loading…
Cancel
Save