[client] egl: avoid overflowing damage buffer

We allocate 10 rectangles for overlay damage as agreed on Discord.
This commit is contained in:
Quantum 2021-07-22 03:52:13 -04:00 committed by Geoffrey McRae
parent fdbdf6f167
commit 58ab77d237

View file

@ -1007,8 +1007,8 @@ bool egl_render(void * opaque, LG_RendererRotate rotate, const bool newFrame)
hasOverlay |= egl_help_render(this->help, this->screenScaleX, this->screenScaleY); hasOverlay |= egl_help_render(this->help, this->screenScaleX, this->screenScaleY);
hasOverlay |= egl_damage_render(this->damage, newFrame ? desktopDamage : NULL); hasOverlay |= egl_damage_render(this->damage, newFrame ? desktopDamage : NULL);
struct Rect damage[KVMFR_MAX_DAMAGE_RECTS + 2]; struct Rect damage[KVMFR_MAX_DAMAGE_RECTS + 12];
int damageIdx = app_renderOverlay(damage, KVMFR_MAX_DAMAGE_RECTS); int damageIdx = app_renderOverlay(damage, 10);
// if no overlay // if no overlay
if (damageIdx == -1) if (damageIdx == -1)