osd_libass: fix stupid dangling pointer crash

append_utf8_buffer() reallocates the buffer passed to it, and returns
the new pointer.

This bug was originally introduced in mplayer2 when that project merged
mpv's osd_libass.c. That merge changed some minor things, including ASS
escape handling. When mpv used this better method of escape handling too
(commit 0ff7dd992f), the bug was duplicated.
This commit is contained in:
wm4 2012-10-20 20:50:40 +02:00
parent 933805daa1
commit 7b65202e47
1 changed files with 1 additions and 1 deletions

View File

@ -246,7 +246,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;