fix segfault when trying to write outside of frameBuffer

pull/1/head
dscho 20 years ago
parent b7dae538f6
commit b9a8f19bb4

@ -24,7 +24,7 @@ int rfbDrawChar(rfbScreenInfoPtr rfbScreen,rfbFontDataPtr font,
d=*data; d=*data;
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); memcpy(rfbScreen->frameBuffer+(y+j)*rowstride+(x+i)*bpp,colour,bpp);
d<<=1; d<<=1;
} }

Loading…
Cancel
Save