bugfix: Fix length of returned buffer on x11 when using the wire-transferred buffer

total_len() computes the number of bytes, while the wire Vec holds u32.
This commit is contained in:
Simon Hausmann 2023-09-06 17:05:17 +02:00 committed by GitHub
parent 53ae12a637
commit 9b44f2eaea
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 1 deletions

View file

@ -486,7 +486,7 @@ impl Buffer {
match self {
Buffer::Shm(ref mut shm) => shm.alloc_segment(conn, total_len(width, height)),
Buffer::Wire(wire) => {
wire.resize(total_len(width, height), 0);
wire.resize(total_len(width, height) / 4, 0);
Ok(())
}
}