LibVNCClient: fix possible infinite loop

Closes #251
(cherry picked from commit c3115350eb8bb635d0fdb4dbbb0d0541f38ed19c)
pull/38/head
Christian Beier 6 years ago committed by Slávek Banko
parent 20e7000d0c
commit 90147500e0
No known key found for this signature in database
GPG Key ID: 608F5293A04BE668

@ -987,7 +987,7 @@ HandleRFBServerMessage()
/* Regardless of cause, do not divide by zero. */
linesToRead = bytesPerLine ? (BUFFER_SIZE / bytesPerLine) : 0;
while (rect.r.h > 0) {
while (linesToRead && rect.r.h > 0) {
if (linesToRead > rect.r.h)
linesToRead = rect.r.h;

Loading…
Cancel
Save