From 10d40f27c9f65ef1bf2f7169bb5fd62dd81a20fa Mon Sep 17 00:00:00 2001 From: Dominik Drobek Date: Sat, 25 Jan 2020 07:24:27 +0700 Subject: libraries/id3lib: Add upstream patches. Signed-off-by: Willy Sudiarto Raharjo --- .../id3lib/patches/31-fix-utf16-stringlists.patch | 24 ++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 libraries/id3lib/patches/31-fix-utf16-stringlists.patch (limited to 'libraries/id3lib/patches/31-fix-utf16-stringlists.patch') diff --git a/libraries/id3lib/patches/31-fix-utf16-stringlists.patch b/libraries/id3lib/patches/31-fix-utf16-stringlists.patch new file mode 100644 index 0000000000..3582238743 --- /dev/null +++ b/libraries/id3lib/patches/31-fix-utf16-stringlists.patch @@ -0,0 +1,24 @@ +This patch fixes tag corruption after pipe characters. + +Author: Urs Fleisch +Fixes: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=680915 +--- a/src/io_helpers.cpp ++++ b/src/io_helpers.cpp +@@ -373,10 +373,17 @@ + //} + // Right code + unsigned char *pdata = (unsigned char *) data.c_str(); ++ unicode_t lastCh = BOM; + for (size_t i = 0; i < size; i += 2) + { + unicode_t ch = (pdata[i] << 8) | pdata[i+1]; ++ if (lastCh == 0 && ch != BOM) ++ { ++ // Last character was NULL, so start next string with BOM. ++ writer.writeChars((const unsigned char*) &BOM, 2); ++ } + writer.writeChars((const unsigned char*) &ch, 2); ++ lastCh = ch; + } + // End patch + } -- cgit v1.2.3