Commit 3e277204 authored by Aleix Pol Gonzalez's avatar Aleix Pol Gonzalez 🐧
Browse files

Do not crash when connecting to a faulty framebuffer

While doing some tests on krfb I get a -1 on the width/height. Not
something a user would generally find but we also better not crash.
parent c833d934
Pipeline #88762 passed with stage
in 39 seconds
......@@ -180,6 +180,9 @@ rfbBool VncClientThread::newclient()
const int width = cl->width, height = cl->height, depth = cl->format.bitsPerPixel;
const int size = width * height * (depth / 8);
if (size <= 0) {
return false;
}
if (frameBuffer)
delete [] frameBuffer; // do not leak if we get a new framebuffer size
frameBuffer = new uint8_t[size];
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment