summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authordscho <dscho>2005-01-14 14:35:00 +0000
committerdscho <dscho>2005-01-14 14:35:00 +0000
commitb9a8f19bb493c1070d6f7b355f3265782971d2d0 (patch)
tree5374ec962fbe01052419cad60583a228cb7a961b
parentb7dae538f671a4598390d4f074c86c7ad3fdd796 (diff)
downloadlibtdevnc-b9a8f19bb493c1070d6f7b355f3265782971d2d0.tar.gz
libtdevnc-b9a8f19bb493c1070d6f7b355f3265782971d2d0.zip
fix segfault when trying to write outside of frameBuffer
-rwxr-xr-xlibvncserver/font.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/libvncserver/font.c b/libvncserver/font.c
index 515b506..120ef7b 100755
--- a/libvncserver/font.c
+++ b/libvncserver/font.c
@@ -24,7 +24,7 @@ int rfbDrawChar(rfbScreenInfoPtr rfbScreen,rfbFontDataPtr font,
d=*data;
data++;
}
- if(d&0x80)
+ if(d&0x80 && y+j>=0 && x+i>=0 && y+j<rfbScreen->height && x+i<rfbScreen->width)
memcpy(rfbScreen->frameBuffer+(y+j)*rowstride+(x+i)*bpp,colour,bpp);
d<<=1;
}