Browse Source

Merge pull request #113135 from deralmas/buffer-jaywalking

Wayland: Fix trailing garbage error while using the embedder on Jay
Rémi Verschelde 3 weeks ago
parent
commit
e28ef68957
1 changed files with 1 additions and 2 deletions
  1. 1 2
      platform/linuxbsd/wayland/wayland_embedder.cpp

+ 1 - 2
platform/linuxbsd/wayland/wayland_embedder.cpp

@@ -1207,7 +1207,6 @@ WaylandEmbedder::MessageStatus WaylandEmbedder::handle_request(LocalObjectHandle
 	DEBUG_LOG_WAYLAND_EMBED(vformat("Client #%d -> %s::%s(%s) l0x%x g0x%x", client->socket, interface->name, message.name, message.signature, local_id, global_id));
 
 	const uint32_t *body = msg_data + 2;
-	size_t body_len = msg_len - (WL_WORD_SIZE * 2);
 
 	if (registry_globals_names.has(global_id)) {
 		int global_name = registry_globals_names[global_id];
@@ -1623,7 +1622,7 @@ WaylandEmbedder::MessageStatus WaylandEmbedder::handle_request(LocalObjectHandle
 			// Args: int x, int y, int width, int height.
 			pos_data->anchor_rect = Rect2i(body[0], body[1], body[2], body[3]);
 
-			send_wayland_message(compositor_socket, global_id, p_opcode, body, body_len);
+			send_wayland_message(compositor_socket, global_id, p_opcode, { body[0], body[1], body[2], body[3] });
 			return MessageStatus::HANDLED;
 		}
 	}