mirror of
https://github.com/gnif/LookingGlass.git
synced 2025-01-03 19:27:10 +00:00
[client] egl: fix undefined behaviour with zero size array
This commit is contained in:
parent
c5f71d18c4
commit
dca5da02a0
2 changed files with 9 additions and 0 deletions
|
@ -107,6 +107,12 @@ inline static void rectToVertices(GLfloat * vertex, const FrameDamageRect * rect
|
||||||
void egl_desktopRectsUpdate(EGL_DesktopRects * rects, const struct DamageRects * data,
|
void egl_desktopRectsUpdate(EGL_DesktopRects * rects, const struct DamageRects * data,
|
||||||
int width, int height)
|
int width, int height)
|
||||||
{
|
{
|
||||||
|
if (data && data->count == 0)
|
||||||
|
{
|
||||||
|
rects->count = 0;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
GLfloat vertices[(!data || data->count < 0 ? 1 : data->count) * 8];
|
GLfloat vertices[(!data || data->count < 0 ? 1 : data->count) * 8];
|
||||||
if (!data || data->count < 0)
|
if (!data || data->count < 0)
|
||||||
{
|
{
|
||||||
|
|
|
@ -211,6 +211,9 @@ inline static bool rectIntersects(const FrameDamageRect * r1, const FrameDamageR
|
||||||
|
|
||||||
int rectsMergeOverlapping(FrameDamageRect * rects, int count)
|
int rectsMergeOverlapping(FrameDamageRect * rects, int count)
|
||||||
{
|
{
|
||||||
|
if (count == 0)
|
||||||
|
return 0;
|
||||||
|
|
||||||
bool removed[count];
|
bool removed[count];
|
||||||
bool changed;
|
bool changed;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue