diff options
author | Grigori Goronzy <greg@chown.ath.cx> | 2015-09-01 16:33:33 +0200 |
---|---|---|
committer | wm4 <wm4@nowhere> | 2015-09-01 17:13:42 +0200 |
commit | fda28f6106caf7d450847444a363adc042b325b9 (patch) | |
tree | f72e101a3fd824d062702977a8d7182e6309ac44 | |
parent | 6585f07a2ca8a823974e11fc9a953a08456a2075 (diff) | |
download | libass-fda28f6106caf7d450847444a363adc042b325b9.tar.bz2 libass-fda28f6106caf7d450847444a363adc042b325b9.tar.xz |
directwrite: fix fallback for codepoint 0
-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); |