From 7c7e8e765c06a8af13c1f2662f1c7084c937738a Mon Sep 17 00:00:00 2001 From: Christian Beier Date: Fri, 17 Apr 2015 12:31:13 +0200 Subject: [PATCH] Re-add the useful bits of 9aa9ac59b4cb10bfca93456a3098e348de172d7f. --- libvncclient/rfbproto.c | 4 ++++ libvncclient/vncviewer.c | 3 +++ 2 files changed, 7 insertions(+) diff --git a/libvncclient/rfbproto.c b/libvncclient/rfbproto.c index 721c3ae..e2a583c 100644 --- a/libvncclient/rfbproto.c +++ b/libvncclient/rfbproto.c @@ -167,6 +167,10 @@ static void FillRectangle(rfbClient* client, int x, int y, int w, int h, uint32_ static void CopyRectangle(rfbClient* client, uint8_t* buffer, int x, int y, int w, int h) { int j; + if (client->frameBuffer == NULL) { + return; + } + #define COPY_RECT(BPP) \ { \ int rs = w * BPP / 8, rs2 = client->width * BPP / 8; \ diff --git a/libvncclient/vncviewer.c b/libvncclient/vncviewer.c index 4f87f01..af0a50b 100644 --- a/libvncclient/vncviewer.c +++ b/libvncclient/vncviewer.c @@ -154,6 +154,9 @@ rfbClient* rfbGetClient(int bitsPerSample,int samplesPerPixel, /* default: use complete frame buffer */ client->updateRect.x = -1; + client->frameBuffer = NULL; + client->outputWindow = 0; + client->format.bitsPerPixel = bytesPerPixel*8; client->format.depth = bitsPerSample*samplesPerPixel; client->appData.requestedDepth=client->format.depth;