From 66655601770a793bdbe83e39f004fe545b460751 Mon Sep 17 00:00:00 2001 From: Norihiro Kamae Date: Tue, 8 Oct 2024 12:19:11 +0900 Subject: [PATCH] Ensure bmalloc always takes positive size --- src/obs-vnc-source-thread.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/obs-vnc-source-thread.c b/src/obs-vnc-source-thread.c index 7b68fad..083dfb5 100644 --- a/src/obs-vnc-source-thread.c +++ b/src/obs-vnc-source-thread.c @@ -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);