From fda28f6106caf7d450847444a363adc042b325b9 Mon Sep 17 00:00:00 2001 From: Grigori Goronzy Date: Tue, 1 Sep 2015 16:33:33 +0200 Subject: directwrite: fix fallback for codepoint 0 --- libass/ass_directwrite.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/libass/ass_directwrite.c b/libass/ass_directwrite.c index 333407d..86b0b4b 100644 --- a/libass/ass_directwrite.c +++ b/libass/ass_directwrite.c @@ -441,11 +441,13 @@ static char *get_fallback(void *priv, const char *base, uint32_t codepoint) // DirectWrite may not have found a valid fallback, so check that // the selected font actually has the requested glyph. - hr = IDWriteFont_HasCharacter(font, codepoint, &exists); - if (FAILED(hr) || !exists) { - IDWriteLocalizedStrings_Release(familyNames); - IDWriteFont_Release(font); - return NULL; + if (codepoint > 0) { + hr = IDWriteFont_HasCharacter(font, codepoint, &exists); + if (FAILED(hr) || !exists) { + IDWriteLocalizedStrings_Release(familyNames); + IDWriteFont_Release(font); + return NULL; + } } int size_needed = WideCharToMultiByte(CP_UTF8, 0, temp_name, -1, NULL, 0,NULL, NULL); -- cgit v1.2.3