Henri Verbeet : wined3d: Validate that the source and destination dimensions match in wined3d_device_update_texture ().
Alexandre Julliard
julliard at winehq.org
Mon Apr 10 15:37:17 CDT 2017
Module: wine
Branch: master
Commit: 114114f137530d9c8daaec54a10ff04e53878b1a
URL: http://source.winehq.org/git/wine.git/?a=commit;h=114114f137530d9c8daaec54a10ff04e53878b1a
Author: Henri Verbeet <hverbeet at codeweavers.com>
Date: Sun Apr 9 22:36:39 2017 +0200
wined3d: Validate that the source and destination dimensions match in wined3d_device_update_texture().
Signed-off-by: Henri Verbeet <hverbeet at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
---
dlls/wined3d/device.c | 16 ++++++++--------
1 file changed, 8 insertions(+), 8 deletions(-)
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index bd07053..c94e88b 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -3551,14 +3551,6 @@ static HRESULT wined3d_device_update_texture_3d(struct wined3d_device *device,
TRACE("device %p, src_texture %p, src_level %u, dst_texture %p, level_count %u.\n",
device, src_texture, src_level, dst_texture, level_count);
- if (wined3d_texture_get_level_width(src_texture, src_level) != dst_texture->resource.width
- || wined3d_texture_get_level_height(src_texture, src_level) != dst_texture->resource.height
- || wined3d_texture_get_level_depth(src_texture, src_level) != dst_texture->resource.depth)
- {
- WARN("Source and destination dimensions do not match.\n");
- return WINED3DERR_INVALIDCALL;
- }
-
context = context_acquire(device, NULL, 0);
/* Only a prepare, since we're uploading entire volumes. */
@@ -3652,6 +3644,14 @@ HRESULT CDECL wined3d_device_update_texture(struct wined3d_device *device,
++src_skip_levels;
}
+ if (wined3d_texture_get_level_width(src_texture, src_skip_levels) != dst_texture->resource.width
+ || wined3d_texture_get_level_height(src_texture, src_skip_levels) != dst_texture->resource.height
+ || wined3d_texture_get_level_depth(src_texture, src_skip_levels) != dst_texture->resource.depth)
+ {
+ WARN("Source and destination dimensions do not match.\n");
+ return WINED3DERR_INVALIDCALL;
+ }
+
/* Make sure that the destination texture is loaded. */
context = context_acquire(device, NULL, 0);
wined3d_texture_load(dst_texture, context, FALSE);
More information about the wine-cvs
mailing list