app_server: fix stack overflow crash if too many windows are tiled

Fixes #15796.

Change-Id: I24c29215116e6bad37f0a56e141d6fc26bbe4fb2
Reviewed-on: https://review.haiku-os.org/c/haiku/+/2680
Reviewed-by: Adrien Destugues <pulkomandy@gmail.com>
This commit is contained in:
X512 2020-05-11 16:44:56 +09:00 committed by waddlesplash
parent f12419a91d
commit 83bd4fdac3

View File

@ -439,6 +439,8 @@ TabDecorator::_DistributeTabSize(float delta)
} }
float minus = ceilf(std::min(maxTabSize - secMaxTabSize, delta)); float minus = ceilf(std::min(maxTabSize - secMaxTabSize, delta));
if (minus < 1.0)
return;
delta -= minus; delta -= minus;
minus /= nTabsWithMaxSize; minus /= nTabsWithMaxSize;