From b9a8f19bb493c1070d6f7b355f3265782971d2d0 Mon Sep 17 00:00:00 2001 From: dscho Date: Fri, 14 Jan 2005 14:35:00 +0000 Subject: [PATCH] fix segfault when trying to write outside of frameBuffer --- libvncserver/font.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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+jheight && x+iwidth) memcpy(rfbScreen->frameBuffer+(y+j)*rowstride+(x+i)*bpp,colour,bpp); d<<=1; }