Skip to content

Commit

Permalink
libvncserver/rfbserver: fix possible divide-by-zero
Browse files Browse the repository at this point in the history
Closes #409
  • Loading branch information
bk138 committed May 17, 2020
1 parent 549e0b1 commit 673c07a
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions libvncserver/rfbserver.c
Expand Up @@ -3369,6 +3369,9 @@ rfbSendRectEncodingRaw(rfbClientPtr cl,
char *fbptr = (cl->scaledScreen->frameBuffer + (cl->scaledScreen->paddedWidthInBytes * y)
+ (x * (cl->scaledScreen->bitsPerPixel / 8)));

if(!h || !w)
return TRUE; /* nothing to send */

/* Flush the buffer to guarantee correct alignment for translateFn(). */
if (cl->ublen > 0) {
if (!rfbSendUpdateBuf(cl))
Expand Down

0 comments on commit 673c07a

Please sign in to comment.