From 488a47e3dd20d558c52d22369a2e6b87df208656 Mon Sep 17 00:00:00 2001 From: SpaceOne Date: Wed, 27 Jan 2016 10:26:20 +0100 Subject: Ignore null pointers in FillRectangle() and CopyRectangleFromRectangle() --- libvncclient/rfbproto.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'libvncclient') diff --git a/libvncclient/rfbproto.c b/libvncclient/rfbproto.c index e2a583c..187a56a 100644 --- a/libvncclient/rfbproto.c +++ b/libvncclient/rfbproto.c @@ -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;iframeBuffer == 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; \ -- cgit v1.2.1