[PATCH] wined3d: Validate pitch against the new format in wined3d_texture_update_desc().

Paul Gofman pgofman at codeweavers.com
Mon Oct 25 07:15:56 CDT 2021


Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=51907
Signed-off-by: Paul Gofman <pgofman at codeweavers.com>
---
 dlls/wined3d/texture.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/dlls/wined3d/texture.c b/dlls/wined3d/texture.c
index f031daef373..df42f2d766b 100644
--- a/dlls/wined3d/texture.c
+++ b/dlls/wined3d/texture.c
@@ -1887,7 +1887,7 @@ HRESULT CDECL wined3d_texture_update_desc(struct wined3d_texture *texture, unsig
      * requires a 4-byte aligned pitch and doesn't support texture formats
      * larger than 4 bytes per pixel nor any format using 3 bytes per pixel.
      * This check is here to verify that the assumption holds. */
-    if (pitch % texture->resource.format->byte_count)
+    if (pitch % format->byte_count)
     {
         WARN("Pitch unsupported, not a multiple of the texture format byte width.\n");
         return WINED3DERR_INVALIDCALL;
-- 
2.31.1




More information about the wine-devel mailing list