From 67ea8e06ba05192da2d26cd28e7aeb261dc85bb2 Mon Sep 17 00:00:00 2001 From: Geoffrey McRae Date: Sun, 24 Oct 2021 22:57:21 +1100 Subject: [PATCH] [client] egl: use `alloca` instead of typecasted char array --- client/renderers/EGL/egl.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/client/renderers/EGL/egl.c b/client/renderers/EGL/egl.c index db27164e..23dc38d6 100644 --- a/client/renderers/EGL/egl.c +++ b/client/renderers/EGL/egl.c @@ -957,11 +957,10 @@ static bool egl_render(LG_Renderer * renderer, LG_RendererRotate rotate, struct CursorState cursorState = { .visible = false }; struct DesktopDamage * desktopDamage; - char accumulated_[ + struct DamageRects * accumulated = (struct DamageRects *)alloca( sizeof(struct DamageRects) + MAX_ACCUMULATED_DAMAGE * sizeof(struct FrameDamageRect) - ]; - struct DamageRects * accumulated = (struct DamageRects *) accumulated_; + ); accumulated->count = 0; INTERLOCKED_SECTION(this->desktopDamageLock, {