diff options
-rw-r--r-- | libass/ass_directwrite.c | 12 |
1 files 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); |