[PATCH] wined3d: Handle null semantics in stream output description cache.

Nikolay Sivov nsivov at codeweavers.com
Mon Sep 6 06:54:25 CDT 2021


Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
---

Let me know if a test is useful for this, as it seems like implementation detail.
To see the crash it's enough to create two shaders with matching descriptions, containing gaps.

 dlls/wined3d/device.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/dlls/wined3d/device.c b/dlls/wined3d/device.c
index d2147447ee0..4f7a46340d4 100644
--- a/dlls/wined3d/device.c
+++ b/dlls/wined3d/device.c
@@ -5620,7 +5620,9 @@ static int wined3d_so_desc_compare(const void *key, const struct wine_rb_entry *
 
         if ((ret = (a->stream_idx - b->stream_idx)))
             return ret;
-        if ((ret = strcmp(a->semantic_name, b->semantic_name)))
+        if (!!a->semantic_name ^ !!b->semantic_name)
+            return a->semantic_name ? -1 : 1;
+        if (a->semantic_name && (ret = strcmp(a->semantic_name, b->semantic_name)))
             return ret;
         if ((ret = (a->semantic_idx - b->semantic_idx)))
             return ret;
-- 
2.33.0




More information about the wine-devel mailing list