summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rwxr-xr-xlibvncserver/font.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libvncserver/font.c b/libvncserver/font.c
index 8ba1020..a9091d2 100755
--- a/libvncserver/font.c
+++ b/libvncserver/font.c
@@ -24,7 +24,8 @@ int rfbDrawChar(rfbScreenInfoPtr rfbScreen,rfbFontDataPtr font,
d=*data;
data++;
}
- if(d&0x80)
+ if(d&0x80 && y+j >= 0 && y+j < rfbScreen->height &&
+ x+i >= 0 && x+i < rfbScreen->width)
memcpy(rfbScreen->frameBuffer+(y+j)*rowstride+(x+i)*bpp,colour,bpp);
d<<=1;
}