Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 3b138038 authored by Cylen Yao's avatar Cylen Yao Committed by Android Git Automerger
Browse files

am 72299bf0: [Bug]NE when playing mp3 with incorrect UTF16 char

* commit '72299bf0':
  [Bug]NE when playing mp3 with incorrect UTF16 char
parents 9e55879f 72299bf0
Loading
Loading
Loading
Loading
+2 −1
Original line number Diff line number Diff line
@@ -342,7 +342,8 @@ void utf16_to_utf8(const char16_t* src, size_t src_len, char* dst)
    while (cur_utf16 < end_utf16) {
        char32_t utf32;
        // surrogate pairs
        if ((*cur_utf16 & 0xFC00) == 0xD800) {
        if((*cur_utf16 & 0xFC00) == 0xD800 && (cur_utf16 + 1) < end_utf16
                && (*(cur_utf16 + 1) & 0xFC00) == 0xDC00) {
            utf32 = (*cur_utf16++ - 0xD800) << 10;
            utf32 |= *cur_utf16++ - 0xDC00;
            utf32 += 0x10000;