Added patch to fix check for texture levels in wined3d_device_update_texture.

This commit is contained in:
Sebastian Lackner
2015-04-27 02:13:12 +02:00
parent 58cc16c463
commit 157d49eb57
8 changed files with 83 additions and 22 deletions

View File

@@ -0,0 +1,34 @@
From 9d415a0b7671c0ab067f344ab7c6cb8520b744ff Mon Sep 17 00:00:00 2001
From: Sebastian Lackner <sebastian@fds-team.de>
Date: Mon, 27 Apr 2015 01:20:38 +0200
Subject: wined3d: Fix check for texture levels in
wined3d_device_update_texture.
Based on analysis by Sergey Isakov.
---
dlls/wined3d/device.c | 8 ++++----
1 file changed, 4 insertions(+), 4 deletions(-)
diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index 4954d00..f435739 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -3561,11 +3561,11 @@ HRESULT CDECL wined3d_device_update_texture(struct wined3d_device *device,
return WINED3DERR_INVALIDCALL;
}
- /* Check that both textures have the identical numbers of levels. */
- level_count = wined3d_texture_get_level_count(src_texture);
- if (wined3d_texture_get_level_count(dst_texture) != level_count)
+ /* Check that source texture has equal or more levels than the destination texture. */
+ level_count = wined3d_texture_get_level_count(dst_texture);
+ if (wined3d_texture_get_level_count(src_texture) < level_count)
{
- WARN("Source and destination have different level counts, returning WINED3DERR_INVALIDCALL.\n");
+ WARN("Source has fewer level counts then destination, returning WINED3DERR_INVALIDCALL.\n");
return WINED3DERR_INVALIDCALL;
}
--
2.3.5

View File

@@ -0,0 +1 @@
Fixes: [38048] Fix check for texture levels in wined3d_device_update_texture