summaryrefslogtreecommitdiffstats
path: root/examples/colourmaptest.c
diff options
context:
space:
mode:
authorChristian Beier <dontmind@freeshell.org>2011-03-17 13:11:59 +0100
committerChristian Beier <dontmind@freeshell.org>2011-03-17 13:11:59 +0100
commitbf2470cec69ab00f7213aa136f5a2d486c9da17a (patch)
tree9ff1c77459eabd1ef1fc594c190cbb455c92a0bd /examples/colourmaptest.c
parent6b60690a4a1642c77bd6ac42789c4da6ed770075 (diff)
downloadlibtdevnc-bf2470cec69ab00f7213aa136f5a2d486c9da17a.tar.gz
libtdevnc-bf2470cec69ab00f7213aa136f5a2d486c9da17a.zip
Check rfbGetScreen() return value everywhere.
This fixes a segfault when a server is invoked with the '-help' commandline argument.
Diffstat (limited to 'examples/colourmaptest.c')
-rw-r--r--examples/colourmaptest.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/examples/colourmaptest.c b/examples/colourmaptest.c
index e403164..20ea303 100644
--- a/examples/colourmaptest.c
+++ b/examples/colourmaptest.c
@@ -7,7 +7,8 @@ int main(int argc,char** argv)
uint8_t bytes[256*3];
rfbScreenInfoPtr server=rfbGetScreen(&argc,argv,256,256,8,1,1);
-
+ if(!server)
+ return 0;
server->serverFormat.trueColour=FALSE;
server->colourMap.count=256;
server->colourMap.is16=FALSE;