summaryrefslogtreecommitdiffstats
path: root/sub/osd_libass.c
diff options
context:
space:
mode:
Diffstat (limited to 'sub/osd_libass.c')
-rw-r--r--sub/osd_libass.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sub/osd_libass.c b/sub/osd_libass.c
index 5f17f2fa6f..11173dad7a 100644
--- a/sub/osd_libass.c
+++ b/sub/osd_libass.c
@@ -125,7 +125,7 @@ static char *mangle_ass(const char *in)
char *res = talloc_strdup(NULL, "");
while (*in) {
// As used by osd_get_function_sym().
- if (in[0] == '\xFF') {
+ if (in[0] == '\xFF' && in[1]) {
res = talloc_strdup_append_buffer(res, ASS_USE_OSD_FONT);
res = append_utf8_buffer(res, OSD_CODEPOINTS + in[1]);
res = talloc_strdup_append_buffer(res, "{\\r}");
@@ -137,7 +137,7 @@ static char *mangle_ass(const char *in)
res = talloc_strndup_append_buffer(res, in, 1);
// Break ASS escapes with U+2060 WORD JOINER
if (*in == '\\')
- append_utf8_buffer(res, 0x2060);
+ res = append_utf8_buffer(res, 0x2060);
in++;
}
return res;