Module: wine Branch: master Commit: 842e2e53141aeafa860eb3544255cb22fc963fb6 URL: http://source.winehq.org/git/wine.git/?a=commit;h=842e2e53141aeafa860eb35442...
Author: Nikolay Sivov nsivov@codeweavers.com Date: Mon May 15 12:41:01 2017 +0300
dwrite: Fix locale data buffer length passed to GetLocaleInfoEx().
Signed-off-by: Nikolay Sivov nsivov@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
dlls/dwrite/analyzer.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-)
diff --git a/dlls/dwrite/analyzer.c b/dlls/dwrite/analyzer.c index 5ae16a1..ede2e6d 100644 --- a/dlls/dwrite/analyzer.c +++ b/dlls/dwrite/analyzer.c @@ -31,6 +31,9 @@ WINE_DEFAULT_DEBUG_CHANNEL(dwrite); extern const unsigned short wine_linebreak_table[] DECLSPEC_HIDDEN; extern const unsigned short wine_scripts_table[] DECLSPEC_HIDDEN;
+/* Number of characters needed for LOCALE_SNATIVEDIGITS */ +#define NATIVE_DIGITS_LEN 11 + struct dwritescript_properties { DWRITE_SCRIPT_PROPERTIES props; UINT32 scripttag; /* OpenType script tag */ @@ -1065,7 +1068,7 @@ static DWRITE_NUMBER_SUBSTITUTION_METHOD get_number_substitutes(IDWriteNumberSub switch (method) { case DWRITE_NUMBER_SUBSTITUTION_METHOD_NATIONAL: - GetLocaleInfoEx(numbersubst->locale, lctype | LOCALE_SNATIVEDIGITS, digits, sizeof(digits)/sizeof(digits[0])); + GetLocaleInfoEx(numbersubst->locale, lctype | LOCALE_SNATIVEDIGITS, digits, NATIVE_DIGITS_LEN); break; case DWRITE_NUMBER_SUBSTITUTION_METHOD_CONTEXTUAL: case DWRITE_NUMBER_SUBSTITUTION_METHOD_TRADITIONAL: @@ -1079,7 +1082,7 @@ static DWRITE_NUMBER_SUBSTITUTION_METHOD get_number_substitutes(IDWriteNumberSub break; } } - GetLocaleInfoEx(numbersubst->locale, lctype | LOCALE_SNATIVEDIGITS, digits, sizeof(digits)/sizeof(digits[0])); + GetLocaleInfoEx(numbersubst->locale, lctype | LOCALE_SNATIVEDIGITS, digits, NATIVE_DIGITS_LEN); break; default: ; @@ -1106,8 +1109,8 @@ static HRESULT WINAPI dwritetextanalyzer_GetGlyphs(IDWriteTextAnalyzer2 *iface, struct scriptshaping_context context; struct scriptshaping_cache *cache = NULL; BOOL update_cluster, need_vertical; + WCHAR digits[NATIVE_DIGITS_LEN]; IDWriteFontFace1 *fontface1; - WCHAR digits[11]; WCHAR *string; UINT32 i, g; HRESULT hr = S_OK;