diff --git a/client/renderers/EGL/desktop_rects.c b/client/renderers/EGL/desktop_rects.c index 5c0edf51..8d97e5ce 100644 --- a/client/renderers/EGL/desktop_rects.c +++ b/client/renderers/EGL/desktop_rects.c @@ -107,6 +107,12 @@ inline static void rectToVertices(GLfloat * vertex, const FrameDamageRect * rect void egl_desktopRectsUpdate(EGL_DesktopRects * rects, const struct DamageRects * data, int width, int height) { + if (data && data->count == 0) + { + rects->count = 0; + return; + } + GLfloat vertices[(!data || data->count < 0 ? 1 : data->count) * 8]; if (!data || data->count < 0) { diff --git a/common/src/rects.c b/common/src/rects.c index c6b93699..80257ee6 100644 --- a/common/src/rects.c +++ b/common/src/rects.c @@ -211,6 +211,9 @@ inline static bool rectIntersects(const FrameDamageRect * r1, const FrameDamageR int rectsMergeOverlapping(FrameDamageRect * rects, int count) { + if (count == 0) + return 0; + bool removed[count]; bool changed;