summaryrefslogtreecommitdiff
path: root/audio/id3lib/patches/patch-ai
diff options
context:
space:
mode:
Diffstat (limited to 'audio/id3lib/patches/patch-ai')
-rw-r--r--audio/id3lib/patches/patch-ai28
1 files changed, 28 insertions, 0 deletions
diff --git a/audio/id3lib/patches/patch-ai b/audio/id3lib/patches/patch-ai
new file mode 100644
index 00000000000..a229676d097
--- /dev/null
+++ b/audio/id3lib/patches/patch-ai
@@ -0,0 +1,28 @@
+$NetBSD: patch-ai,v 1.3 2006/09/13 12:06:28 ben Exp $
+
+--- src/io_helpers.cpp.orig 2003-03-01 16:23:00.000000000 -0800
++++ src/io_helpers.cpp
+@@ -363,11 +363,22 @@ size_t io::writeUnicodeText(ID3_Writer&
+ // Write the BOM: 0xFEFF
+ unicode_t BOM = 0xFEFF;
+ writer.writeChars((const unsigned char*) &BOM, 2);
++ // Patch from Spoon : 2004-08-25 14:17
++ // http://sourceforge.net/tracker/index.php?func=detail&aid=1016290&group_id=979&atid=300979
++ // Wrong code
++ //for (size_t i = 0; i < size; i += 2)
++ //{
++ // unicode_t ch = (data[i] << 8) | data[i+1];
++ // writer.writeChars((const unsigned char*) &ch, 2);
++ //}
++ // Right code
++ unsigned char *pdata = (unsigned char *) data.c_str();
+ for (size_t i = 0; i < size; i += 2)
+ {
+- unicode_t ch = (data[i] << 8) | data[i+1];
++ unicode_t ch = (pdata[i] << 8) | pdata[i+1];
+ writer.writeChars((const unsigned char*) &ch, 2);
+ }
++ // End patch
+ }
+ return writer.getCur() - beg;
+ }