Giovanni Mascellani : dwrite: Do not segfault when there are no typographic features to return.
Alexandre Julliard
julliard at winehq.org
Mon Jun 7 15:02:07 CDT 2021
Module: wine
Branch: stable
Commit: 4b774ec3572b9163d7763cd93ccd319da5df62f5
URL: https://source.winehq.org/git/wine.git/?a=commit;h=4b774ec3572b9163d7763cd93ccd319da5df62f5
Author: Giovanni Mascellani <gmascellani at codeweavers.com>
Date: Wed Mar 3 15:25:28 2021 +0100
dwrite: Do not segfault when there are no typographic features to return.
Signed-off-by: Giovanni Mascellani <gmascellani at codeweavers.com>
Signed-off-by: Nikolay Sivov <nsivov at codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard at winehq.org>
(cherry picked from commit 65f5033702780ce355749b09644df57c5305db33)
Signed-off-by: Michael Stefaniuc <mstefani at winehq.org>
---
dlls/dwrite/shape.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/dlls/dwrite/shape.c b/dlls/dwrite/shape.c
index be8a69c27c4..00b589c9e28 100644
--- a/dlls/dwrite/shape.c
+++ b/dlls/dwrite/shape.c
@@ -336,6 +336,12 @@ HRESULT shape_get_typographic_features(struct scriptshaping_context *context, co
shape_get_script_lang_index(context, scripts, MS_GPOS_TAG, &script_index, &language_index);
opentype_get_typographic_features(&context->cache->gpos, script_index, language_index, &t);
+ if (t.count == 0)
+ {
+ *actual_tagcount = 0;
+ return S_OK;
+ }
+
/* Sort and remove duplicates. */
qsort(t.tags, t.count, sizeof(*t.tags), tag_array_sorting_compare);
More information about the wine-cvs
mailing list