mirror of
https://github.com/gnif/LookingGlass.git
synced 2024-11-10 08:38:20 +00:00
[client] egl: fix undefined behaviour with zero size array
This commit is contained in:
parent
c5f71d18c4
commit
dca5da02a0
@ -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)
|
||||
{
|
||||
|
@ -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;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user