mirror of
https://github.com/mpv-player/mpv.git
synced 2025-12-24 20:00:20 +00:00
msg: return zero length if bstr_split_utf8 fails
In theory bstr_split_utf8 should skip invalid sequence and move further,
but it doesn't do that currently, so just the string if unsuported code if
found.
Fixes infinite loop on code.len == 0 condition.
Fixes: 5864b72d1a
This commit is contained in:
@@ -350,7 +350,7 @@ static int term_disp_width(bstr str)
|
|||||||
|
|
||||||
bstr code = bstr_split_utf8(str, &str);
|
bstr code = bstr_split_utf8(str, &str);
|
||||||
if (code.len == 0)
|
if (code.len == 0)
|
||||||
continue;
|
return 0;
|
||||||
|
|
||||||
if (code.len == 1 && *code.start == '\n')
|
if (code.len == 1 && *code.start == '\n')
|
||||||
continue;
|
continue;
|
||||||
|
|||||||
Reference in New Issue
Block a user