[PATCH] dwrite: Do not segfault if typographic features tag table is empty.

Giovanni Mascellani gmascellani at codeweavers.com
Wed Mar 3 05:04:03 CST 2021


Signed-off-by: Giovanni Mascellani <gmascellani at codeweavers.com>
---
 dlls/dwrite/shape.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/dlls/dwrite/shape.c b/dlls/dwrite/shape.c
index 6428bf6ceb0..d425c189a58 100644
--- a/dlls/dwrite/shape.c
+++ b/dlls/dwrite/shape.c
@@ -380,7 +380,7 @@ HRESULT shape_get_typographic_features(struct scriptshaping_context *context, co
         if (t.tags[i] != t.tags[j])
             t.tags[++j] = t.tags[i];
     }
-    t.count = j + 1;
+    t.count = t.count > 0 ? j + 1 : 0;
 
     if (t.count <= max_tagcount)
         memcpy(tags, t.tags, t.count * sizeof(*t.tags));
-- 
2.30.1




More information about the wine-devel mailing list