mirror of
https://gitlab.freedesktop.org/wayland/wayland.git
synced 2026-04-04 07:15:53 -04:00
connection: Limit buffer size bits to WL_BUFFER_DEFAULT_SIZE_POT
The previous code tried to do this but had an off-by-1 error. Signed-off-by: Demi Marie Obenour <demi@invisiblethingslab.com>
This commit is contained in:
parent
507884a123
commit
f8ecb6d531
1 changed files with 1 additions and 1 deletions
|
|
@ -198,7 +198,7 @@ get_max_size_bits_for_size(size_t buffer_size)
|
||||||
uint32_t max_size_bits = WL_BUFFER_DEFAULT_SIZE_POT;
|
uint32_t max_size_bits = WL_BUFFER_DEFAULT_SIZE_POT;
|
||||||
|
|
||||||
|
|
||||||
while (max_size_bits < 8 * sizeof(size_t) && size_pot(max_size_bits) < buffer_size)
|
while (max_size_bits < WL_BUFFER_MAX_SIZE_POT && size_pot(max_size_bits) < buffer_size)
|
||||||
max_size_bits++;
|
max_size_bits++;
|
||||||
|
|
||||||
return max_size_bits;
|
return max_size_bits;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue