Skip to content

Commit

Permalink
Ensure bmalloc always takes positive size
Browse files Browse the repository at this point in the history
  • Loading branch information
norihiro committed Nov 30, 2024
1 parent 9cb29e2 commit 0382723
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/obs-vnc-source-thread.c
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,12 @@ static rfbBool vnc_malloc_fb(rfbClient *client)

debug("vnc_malloc_fb width=%d height=%d\n", client->width, client->height);

if (client->width <= 0 || client->height <= 0) {
blog(LOG_ERROR, "vnc_malloc_fb gets 0-length geometry %dx%d", client->width, client->height);
client->frameBuffer = NULL;
return FALSE;
}

src->frame.width = client->width;
src->frame.height = client->height;
set_updateRect(src, client);
Expand Down

0 comments on commit 0382723

Please sign in to comment.