mirror of
https://github.com/mpv-player/mpv
synced 2025-03-07 06:37:46 +00:00
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:
parent
933805daa1
commit
7b65202e47
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user