Signed-off-by: Józef Kucia jkucia@codeweavers.com --- dlls/d3d8/device.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/dlls/d3d8/device.c b/dlls/d3d8/device.c index 9e82b1e72763..1d892ecf8d31 100644 --- a/dlls/d3d8/device.c +++ b/dlls/d3d8/device.c @@ -2301,8 +2301,10 @@ static void d3d8_device_upload_sysmem_index_buffer(struct d3d8_device *device, unsigned int start_idx, unsigned int idx_count) { struct wined3d_box box = {0, 0, 0, 1, 0, 1}; - struct d3d8_vertexbuffer *d3d8_buffer; + struct wined3d_resource *dst_resource; + struct d3d8_indexbuffer *d3d8_buffer; struct wined3d_buffer *dst_buffer; + struct wined3d_resource_desc desc; enum wined3d_format_id format; unsigned int offset, idx_size; HRESULT hr; @@ -2313,11 +2315,13 @@ static void d3d8_device_upload_sysmem_index_buffer(struct d3d8_device *device, if (!(dst_buffer = wined3d_device_get_index_buffer(device->wined3d_device, &format, &offset))) ERR("Failed to get index buffer.\n"); d3d8_buffer = wined3d_buffer_get_parent(dst_buffer); + dst_resource = wined3d_buffer_get_resource(dst_buffer); + wined3d_resource_get_desc(dst_resource, &desc); idx_size = format == WINED3DFMT_R16_UINT ? 2 : 4; box.left = offset + start_idx * idx_size; - box.right = box.left + idx_count * idx_size; + box.right = min(box.left + idx_count * idx_size, desc.size); if (FAILED(hr = wined3d_device_copy_sub_resource_region(device->wined3d_device, - wined3d_buffer_get_resource(dst_buffer), 0, box.left, 0, 0, + dst_resource, 0, box.left, 0, 0, wined3d_buffer_get_resource(d3d8_buffer->wined3d_buffer), 0, &box, 0))) ERR("Failed to update buffer.\n"); }
Hi,
While running your changed tests on Windows, I think I found new failures. Being a bot and all I'm not very good at pattern recognition, so I might be wrong, but could you please double-check?
Full results can be found at: https://testbot.winehq.org/JobDetails.pl?Key=46345
Your paranoid android.
=== debian9 (build log) ===
X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig)
=== debian9 (build log) ===
X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig) X Error of failed request: BadValue (integer parameter out of range for operation) Major opcode of failed request: 140 (RANDR) Minor opcode of failed request: 21 (RRSetCrtcConfig)