diff options
author | SpaceOne <[email protected]> | 2016-01-27 10:26:20 +0100 |
---|---|---|
committer | Florian Best <[email protected]> | 2016-01-27 10:27:40 +0100 |
commit | 488a47e3dd20d558c52d22369a2e6b87df208656 (patch) | |
tree | 5a975f9bd15f6229a29d83feeb263005496e1f73 /libvncclient | |
parent | 9d4cb568b70443f9137108dd5eaad34523c3664d (diff) | |
download | libtdevnc-488a47e3dd20d558c52d22369a2e6b87df208656.tar.gz libtdevnc-488a47e3dd20d558c52d22369a2e6b87df208656.zip |
Ignore null pointers in FillRectangle() and CopyRectangleFromRectangle()
Diffstat (limited to 'libvncclient')
-rw-r--r-- | libvncclient/rfbproto.c | 8 |
1 files changed, 8 insertions, 0 deletions
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;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; \ |