Commit b71354a1 authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

Fix surrogate detection

(cherry picked from commit 8bce50f4b059f638d5f92323e6fec8c5318c432a)
parent 748381c7
......@@ -280,7 +280,7 @@ size_t vlc_towc (const char *str, uint32_t *restrict pwc)
return -1;
cp |= (c & 0x3f) << 6;
if (unlikely(cp >= 0xD800 && cp < 0xC000)) // UTF-16 surrogate
if (unlikely(cp >= 0xD800 && cp < 0xE000)) // UTF-16 surrogate
return -1;
if (unlikely(cp < (1u << (5 * charlen - 4)))) // non-ASCII overlong
return -1;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment