Signed-off-by: Matteo Bruni mbruni@codeweavers.com --- It should make sure we don't break the queue if we forget to pad CS packet structures.
dlls/wined3d/cs.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/dlls/wined3d/cs.c b/dlls/wined3d/cs.c index 3fd32631ff5..899d5a712e4 100644 --- a/dlls/wined3d/cs.c +++ b/dlls/wined3d/cs.c @@ -2651,8 +2651,9 @@ static void *wined3d_cs_queue_require_space(struct wined3d_cs_queue *queue, size struct wined3d_cs_packet *packet;
header_size = FIELD_OFFSET(struct wined3d_cs_packet, data[0]); - size = (size + header_size - 1) & ~(header_size - 1); packet_size = FIELD_OFFSET(struct wined3d_cs_packet, data[size]); + packet_size = (packet_size + header_size - 1) & ~(header_size - 1); + size = packet_size - header_size; if (packet_size >= WINED3D_CS_QUEUE_SIZE) { ERR("Packet size %lu >= queue size %u.\n",