Submitted By: Bruce Dubbs <bdubbs at linuxfromscratch dot org>
Date: 2017-12-15
Initial Package Version: 3.8.3
Upstream Status: Package is no longer updated - last update 2003
Origin: Arch
Description: A consolidated series of patches to allow building on a
             modern system.

diff -Naur id3lib-3.8.3.orig/ChangeLog id3lib-3.8.3/ChangeLog
--- id3lib-3.8.3.orig/ChangeLog	2017-12-15 22:04:20.639095449 -0600
+++ id3lib-3.8.3/ChangeLog	2017-12-15 22:05:06.615093119 -0600
@@ -1,3 +1,8 @@
+2006-02-17  Jerome Couderc
+
+    * Patch from Spoon to fix UTF-16 writing bug
+      http://sourceforge.net/tracker/index.php?func=detail&aid=1016290&group_id=979&atid=300979
+
 2003-03-02 Sunday 17:38   Thijmen Klok <thijmen@id3lib.org>
 
 	* THANKS (1.20): added more people 
@@ -2261,7 +2266,7 @@
 	* examples/demo_info.cpp (1.19): 
 	(PrintInformation): When printing synced lyrics info, now uses a 
 	MemoryReader, BinaryNumberReader, and TextReader to extract the 
-	infromation from the binary field.  This is a cheat, since these 
+	information from the binary field.  This is a cheat, since these 
 	classes aren't normally exposed to folks using the library. 
 	Hopefully they will be exposed soon enough for the next major
 	release.  
diff -Naur id3lib-3.8.3.orig/configure.in id3lib-3.8.3/configure.in
--- id3lib-3.8.3.orig/configure.in	2017-12-15 22:04:20.640095449 -0600
+++ id3lib-3.8.3/configure.in	2017-12-15 22:05:23.354092270 -0600
@@ -222,12 +222,11 @@
 AC_LANG_CPLUSPLUS
 AC_CHECK_HEADERS(libcw/sys.h)
 AC_CHECK_HEADERS(cctype climits cstdio cstdlib bitset cstring)
-AC_CHECK_HEADERS(fstream iostream iomanip vector \
+AC_CHECK_HEADERS(fstream iostream  vector \
 	,,AC_MSG_ERROR([Missing a vital header file for id3lib - download them here: http://gcc.gnu.org/libstdc++/ or better - compile a newer compiler like gcc3.x])
 )
 AC_CHECK_HEADERS(               \
   string                        \
-  iomanip.h                     \
   ,,AC_MSG_ERROR([Missing a vital header file for id3lib])
 )
 
diff -Naur id3lib-3.8.3.orig/doc/id3v2.3.0.html id3lib-3.8.3/doc/id3v2.3.0.html
--- id3lib-3.8.3.orig/doc/id3v2.3.0.html	2017-12-15 22:04:20.641095449 -0600
+++ id3lib-3.8.3/doc/id3v2.3.0.html	2017-12-15 22:05:06.616093119 -0600
@@ -2157,7 +2157,7 @@
  64.Native American
  65.Cabaret
  66.New Wave
- 67.Psychadelic
+ 67.Psychedelic
  68.Rave
  69.Showtunes
  70.Trailer
@@ -2254,4 +2254,4 @@
 Email: <a href="mailto:johan@id3.org">johan@id3.org</a>
 </p>
 
-</body></html>
\ No newline at end of file
+</body></html>
diff -Naur id3lib-3.8.3.orig/doc/id3v2.3.0.txt id3lib-3.8.3/doc/id3v2.3.0.txt
--- id3lib-3.8.3.orig/doc/id3v2.3.0.txt	2017-12-15 22:04:20.641095449 -0600
+++ id3lib-3.8.3/doc/id3v2.3.0.txt	2017-12-15 22:05:06.616093119 -0600
@@ -1929,7 +1929,7 @@
      64.Native American
      65.Cabaret
      66.New Wave
-     67.Psychadelic
+     67.Psychedelic
      68.Rave
      69.Showtunes
      70.Trailer
diff -Naur id3lib-3.8.3.orig/doc/man/id3convert.1 id3lib-3.8.3/doc/man/id3convert.1
--- id3lib-3.8.3.orig/doc/man/id3convert.1	1969-12-31 18:00:00.000000000 -0600
+++ id3lib-3.8.3/doc/man/id3convert.1	2017-12-15 22:05:06.616093119 -0600
@@ -0,0 +1,47 @@
+.TH ID3CONVERT 1 "May 2000" local "User Command"
+.SH NAME
+id3convert \- Converts between id3v1 and id3v2 tags of an mp3 file.
+.SH SYNOPSIS
+.B id3convert
+.RB [
+.I OPTION
+.RB ]
+.RB [
+.I FILE
+.RB ]
+.br
+.SH DESCRIPTION
+.B Id3convert
+converts between id3v1 and id3v2 tags of an mp3 file. Id3convert will render
+both types of tag by default. Only the last tag type indicated in the option
+list will be used. Non-rendered tags will remain unchanged in the original
+file. Id3convert will also parse and convert Lyrics3 v2.0 frames, but will
+not render them.
+
+.SH OPTIONS
+.TP
+.B \-1, \-\-v1tag
+Render only the id3v1 tag
+.TP
+.B \-2, \-\-v2tag
+Render only the id3v2 tag
+.TP
+.B \-s, \-\-strip
+Strip, rather than render, the tags
+.TP
+.B \-p, \-\-padding
+Use padding in the tag
+.TP
+.B \-h, \-\-help
+Display help and exit
+.TP
+.B \-v, \-\-version
+Display version information and exit
+
+.SH SEE ALSO
+id3tag(1), id3info(1), id3v2(1)
+.SH AUTHOR
+.B id3lib
+was originally designed and implemented by Dirk Mahoney and is
+maintained by Scott Thomas Haug <sth2@cs.wustl.edu>. Manual page written for
+Debian GNU/Linux by Robert Woodcock <rcw@debian.org>.
diff -Naur id3lib-3.8.3.orig/doc/man/id3cp.1 id3lib-3.8.3/doc/man/id3cp.1
--- id3lib-3.8.3.orig/doc/man/id3cp.1	1969-12-31 18:00:00.000000000 -0600
+++ id3lib-3.8.3/doc/man/id3cp.1	2017-12-15 22:05:06.616093119 -0600
@@ -0,0 +1,38 @@
+.TH ID3CP 1 "July 2001" local "User Command"
+.SH NAME
+id3cp \- Copies tags from one file to another.
+.SH SYNOPSIS
+.B id3cp
+.RB [
+.I OPTION
+.RB ] ...
+.RB [
+.I SOURCE
+.RB ]
+.RB [
+.I DEST
+.RB ]
+.br
+.SH DESCRIPTION
+.B Id3cp
+copies tags from SOURCE to DEST.
+.SH OPTIONS
+.TP
+.B \-1, \-\-v1tag
+Render only the id3v1 tag
+.TP
+.B \-2, \-\-v2tag
+Render only the id3v2 tag
+.TP
+.B \-h, \-\-help
+Display help and exit
+.TP
+.B \-v, \-\-version
+Display version information and exit
+.SH SEE ALSO
+id3convert(1), id3info(1), id3v2(1)
+.SH AUTHOR
+.B id3lib
+was originally designed and implemented by Dirk Mahoney and is
+maintained by Scott Thomas Haug <sth2@cs.wustl.edu>. Manual page written for
+Debian GNU/Linux by Robert Woodcock <rcw@debian.org>.
diff -Naur id3lib-3.8.3.orig/doc/man/id3info.1 id3lib-3.8.3/doc/man/id3info.1
--- id3lib-3.8.3.orig/doc/man/id3info.1	1969-12-31 18:00:00.000000000 -0600
+++ id3lib-3.8.3/doc/man/id3info.1	2017-12-15 22:05:06.616093119 -0600
@@ -0,0 +1,31 @@
+.TH ID3INFO 1 "May 2000" local "User Command"
+.SH NAME
+id3info \- Display id3 tag information.
+.SH SYNOPSIS
+.B id3info
+.RB [
+.I OPTION
+.RB ]
+.RB [
+.I FILE
+.RB ]
+.br
+.SH DESCRIPTION
+.B Id3info
+displays both the id3v1 and id3v2 tag information for a file.
+Id3info will not differentiate between the two types of tags.
+.SH OPTIONS
+.TP
+.B \-h, \-\-help
+Display help and exit
+.TP
+.B \-v, \-\-version
+Display version information and exit
+.SH SEE ALSO
+id3convert(1), id3tag(1), id3v2(1)
+.SH AUTHOR
+.B id3lib
+was originally designed and implemented by Dirk Mahoney and is
+maintained by Scott Thomas Haug <sth2@cs.wustl.edu>. Manual page written for
+Debian GNU/Linux by Robert Woodcock <rcw@debian.org>.
+
diff -Naur id3lib-3.8.3.orig/doc/man/id3tag.1 id3lib-3.8.3/doc/man/id3tag.1
--- id3lib-3.8.3.orig/doc/man/id3tag.1	1969-12-31 18:00:00.000000000 -0600
+++ id3lib-3.8.3/doc/man/id3tag.1	2017-12-15 22:05:06.616093119 -0600
@@ -0,0 +1,69 @@
+.TH ID3TAG 1 "May 2000" local "User Command"
+.SH NAME
+id3tag \- Tags an mp3 file with id3v1 and/or id3v2 tags.
+.SH SYNOPSIS
+.B id3tag
+.RB [
+.I OPTION
+.RB ] ...
+.RB [
+.I FILE
+.RB ] ...
+.br
+.SH DESCRIPTION
+.B Id3tag
+will render both types of tag by default.  Only the last
+tag type indicated in the option list will be used.  Non-
+rendered will remain unchanged in the original file.  Will
+also parse and convert Lyrics3 v2.0 frames, but will not
+render them.
+
+.SH OPTIONS
+.TP
+.B \-1, \-\-v1tag
+Render only the id3v1 tag
+.TP
+.B \-2, \-\-v2tag
+Render only the id3v2 tag
+.TP
+.B \-h, \-\-help
+Display help and exit
+.TP
+.B \-v, \-\-version
+Display version information and exit
+.TP
+.B \-a, \-\-artist ARTIST
+Set the artist information
+.TP
+.B \-s, \-\-song SONG
+Set the song title information
+.TP
+.B \-A, \-\-album ALBUM
+Set the album title information
+.TP
+.B \-c, \-\-comment COMMENT
+Set the comment information
+.TP
+.B \-C, \-\-desc DESCRIPTION
+Set the comment description
+.TP
+.B \-g, \-\-genre num
+Set the genre number
+.TP
+.B \-y, \-\-year num
+Set the year
+.TP
+.B \-t, \-\-track num
+Set the track number
+.TP
+.B \-T, \-\-total num
+Set the total number of tracks on the album
+
+.SH SEE ALSO
+id3convert(1), id3info(1), id3v2(1)
+.SH AUTHOR
+.B id3lib
+was originally designed and implemented by Dirk Mahoney and is
+maintained by Scott Thomas Haug <sth2@cs.wustl.edu>. Manual page written for
+Debian GNU/Linux by Robert Woodcock <rcw@debian.org>.
+
diff -Naur id3lib-3.8.3.orig/examples/demo_convert.cpp id3lib-3.8.3/examples/demo_convert.cpp
--- id3lib-3.8.3.orig/examples/demo_convert.cpp	2017-12-15 22:04:20.642095449 -0600
+++ id3lib-3.8.3/examples/demo_convert.cpp	2017-12-15 22:05:06.616093119 -0600
@@ -84,7 +84,7 @@
   }
 }
 
-int main( unsigned int argc, char * const argv[])
+int main(int argc, char * const argv[])
 {
   flags_t ulFlag = ID3TT_ALL;
   gengetopt_args_info args;
diff -Naur id3lib-3.8.3.orig/examples/demo_copy.cpp id3lib-3.8.3/examples/demo_copy.cpp
--- id3lib-3.8.3.orig/examples/demo_copy.cpp	2017-12-15 22:04:20.642095449 -0600
+++ id3lib-3.8.3/examples/demo_copy.cpp	2017-12-15 22:05:06.616093119 -0600
@@ -81,7 +81,7 @@
   }
 }
 
-int main( unsigned int argc, char * const argv[])
+int main(int argc, char * const argv[])
 {
   int ulFlag = ID3TT_ID3;
   ID3D_INIT_DOUT();
diff -Naur id3lib-3.8.3.orig/examples/demo_info.cpp id3lib-3.8.3/examples/demo_info.cpp
--- id3lib-3.8.3.orig/examples/demo_info.cpp	2017-12-15 22:04:20.642095449 -0600
+++ id3lib-3.8.3/examples/demo_info.cpp	2017-12-15 22:05:06.616093119 -0600
@@ -309,7 +309,7 @@
 
 #define DEBUG
 
-int main( unsigned int argc, char * const argv[])
+int main(int argc, char * const argv[])
 {
   ID3D_INIT_DOUT();
 
diff -Naur id3lib-3.8.3.orig/examples/demo_tag.cpp id3lib-3.8.3/examples/demo_tag.cpp
--- id3lib-3.8.3.orig/examples/demo_tag.cpp	2017-12-15 22:04:20.643095449 -0600
+++ id3lib-3.8.3/examples/demo_tag.cpp	2017-12-15 22:05:06.616093119 -0600
@@ -46,7 +46,7 @@
     os << "v2";
 }
 
-int main( unsigned int argc, char * const argv[])
+int main(int argc, char * const argv[])
 {
   int ulFlag = ID3TT_ID3;
   ID3D_INIT_DOUT();
diff -Naur id3lib-3.8.3.orig/examples/findeng.cpp id3lib-3.8.3/examples/findeng.cpp
--- id3lib-3.8.3.orig/examples/findeng.cpp	2017-12-15 22:04:20.642095449 -0600
+++ id3lib-3.8.3/examples/findeng.cpp	2017-12-15 22:05:06.617093119 -0600
@@ -9,7 +9,7 @@
 using std::cout;
 using std::endl;
 
-int main(unsigned argc, char* argv[])
+int main(int argc, char* argv[])
 {
   ID3D_INIT_DOUT();
   ID3D_INIT_WARNING();
diff -Naur id3lib-3.8.3.orig/examples/findstr.cpp id3lib-3.8.3/examples/findstr.cpp
--- id3lib-3.8.3.orig/examples/findstr.cpp	2017-12-15 22:04:20.642095449 -0600
+++ id3lib-3.8.3/examples/findstr.cpp	2017-12-15 22:05:06.617093119 -0600
@@ -9,7 +9,7 @@
 using std::cout;
 using std::endl;
 
-int main(unsigned argc, char* argv[])
+int main(int argc, char* argv[])
 {
   ID3D_INIT_DOUT();
   ID3D_INIT_WARNING();
diff -Naur id3lib-3.8.3.orig/examples/test_io.cpp id3lib-3.8.3/examples/test_io.cpp
--- id3lib-3.8.3.orig/examples/test_io.cpp	2017-12-15 22:04:20.643095449 -0600
+++ id3lib-3.8.3/examples/test_io.cpp	2017-12-15 22:05:06.617093119 -0600
@@ -11,6 +11,9 @@
 #include <id3/io_strings.h>
 #include <id3/utils.h>
 
+using std::cin;
+using std::hex;
+using std::dec;
 using std::cout;
 using std::endl;
 using std::cerr;
@@ -18,7 +21,7 @@
 using namespace dami;
 
 int
-main(size_t argc, const char** argv)
+main(int argc, const char** argv)
 {
   ID3D_INIT_DOUT();
   ID3D_INIT_WARNING();
diff -Naur id3lib-3.8.3.orig/id3com/id3com.idl id3lib-3.8.3/id3com/id3com.idl
--- id3lib-3.8.3.orig/id3com/id3com.idl	2017-12-15 22:04:20.642095449 -0600
+++ id3lib-3.8.3/id3com/id3com.idl	2017-12-15 22:05:06.617093119 -0600
@@ -179,7 +179,7 @@
       /* USER */ ID3_TERMSOFUSE,        /**< Terms of use */
       /* USLT */ ID3_UNSYNCEDLYRICS,    /**< Unsynchronized lyric/text transcription */
       /* WCOM */ ID3_WWWCOMMERCIALINFO, /**< Commercial information */
-      /* WCOP */ ID3_WWWCOPYRIGHT,      /**< Copyright/Legal infromation */
+      /* WCOP */ ID3_WWWCOPYRIGHT,      /**< Copyright/Legal information */
       /* WOAF */ ID3_WWWAUDIOFILE,      /**< Official audio file webpage */
       /* WOAR */ ID3_WWWARTIST,         /**< Official artist/performer webpage */
       /* WOAS */ ID3_WWWAUDIOSOURCE,    /**< Official audio source webpage */
diff -Naur id3lib-3.8.3.orig/include/id3/globals.h id3lib-3.8.3/include/id3/globals.h
--- id3lib-3.8.3.orig/include/id3/globals.h	2017-12-15 22:04:20.641095449 -0600
+++ id3lib-3.8.3/include/id3/globals.h	2017-12-15 22:05:06.617093119 -0600
@@ -313,7 +313,7 @@
   /* USER */ ID3FID_TERMSOFUSE,        /**< Terms of use */
   /* USLT */ ID3FID_UNSYNCEDLYRICS,    /**< Unsynchronized lyric/text transcription */
   /* WCOM */ ID3FID_WWWCOMMERCIALINFO, /**< Commercial information */
-  /* WCOP */ ID3FID_WWWCOPYRIGHT,      /**< Copyright/Legal infromation */
+  /* WCOP */ ID3FID_WWWCOPYRIGHT,      /**< Copyright/Legal information */
   /* WOAF */ ID3FID_WWWAUDIOFILE,      /**< Official audio file webpage */
   /* WOAR */ ID3FID_WWWARTIST,         /**< Official artist/performer webpage */
   /* WOAS */ ID3FID_WWWAUDIOSOURCE,    /**< Official audio source webpage */
@@ -608,7 +608,7 @@
   "Native American",   //64
   "Cabaret",           //65
   "New Wave",          //66
-  "Psychadelic",       //67
+  "Psychedelic",       //67
   "Rave",              //68
   "Showtunes",         //69
   "Trailer",           //70
@@ -686,7 +686,7 @@
   "Christian Rock ",       //141
   "Merengue",              //142
   "Salsa",                 //143
-  "Trash Metal",           //144
+  "Thrash Metal",          //144
   "Anime",                 //145
   "JPop",                  //146
   "Synthpop"               //147
diff -Naur id3lib-3.8.3.orig/include/id3/id3lib_strings.h id3lib-3.8.3/include/id3/id3lib_strings.h
--- id3lib-3.8.3.orig/include/id3/id3lib_strings.h	2017-12-15 22:04:20.641095449 -0600
+++ id3lib-3.8.3/include/id3/id3lib_strings.h	2017-12-15 22:05:06.617093119 -0600
@@ -30,6 +30,7 @@
 #define _ID3LIB_STRINGS_H_
 
 #include <string>
+#include <cstring>
 
 #if (defined(__GNUC__) && (__GNUC__ >= 3) || (defined(_MSC_VER) && _MSC_VER > 1000))
 namespace std
diff -Naur id3lib-3.8.3.orig/include/id3/writers.h id3lib-3.8.3/include/id3/writers.h
--- id3lib-3.8.3.orig/include/id3/writers.h	2017-12-15 22:04:20.641095449 -0600
+++ id3lib-3.8.3/include/id3/writers.h	2017-12-15 22:05:06.617093119 -0600
@@ -30,7 +30,7 @@
 
 #include "id3/writer.h"
 #include "id3/id3lib_streams.h"
-//#include <string.h>
+#include <cstring>
 
 class ID3_CPP_EXPORT ID3_OStreamWriter : public ID3_Writer
 {
diff -Naur id3lib-3.8.3.orig/include/id3.h id3lib-3.8.3/include/id3.h
--- id3lib-3.8.3.orig/include/id3.h	2017-12-15 22:04:20.641095449 -0600
+++ id3lib-3.8.3/include/id3.h	2017-12-15 22:05:06.617093119 -0600
@@ -104,6 +104,9 @@
   ID3_C_EXPORT void                 CCONV ID3Field_GetBINARY          (const ID3Field *field, uchar *buffer, size_t buffLength);
   ID3_C_EXPORT void                 CCONV ID3Field_FromFile           (ID3Field *field, const char *fileName);
   ID3_C_EXPORT void                 CCONV ID3Field_ToFile             (const ID3Field *field, const char *fileName);
+  ID3_C_EXPORT bool                 CCONV ID3Field_SetEncoding        (ID3Field *field, ID3_TextEnc enc);
+  ID3_C_EXPORT ID3_TextEnc          CCONV ID3Field_GetEncoding        (const ID3Field *field);
+  ID3_C_EXPORT bool                 CCONV ID3Field_IsEncodable        (const ID3Field *field);
 
   /* field-info wrappers */
   ID3_C_EXPORT char*                CCONV ID3FrameInfo_ShortName     (ID3_FrameID frameid);
diff -Naur id3lib-3.8.3.orig/Makefile.am id3lib-3.8.3/Makefile.am
--- id3lib-3.8.3.orig/Makefile.am	2017-12-15 22:04:20.639095449 -0600
+++ id3lib-3.8.3/Makefile.am	2017-12-15 22:05:06.617093119 -0600
@@ -12,6 +12,8 @@
 # require automake 1.5
 AUTOMAKE_OPTIONS = 1.5
 
+ACLOCAL_AMFLAGS = -I m4
+
 EXTRA_DIST =                    \
         HISTORY                 \
         config.h.win32          \
diff -Naur id3lib-3.8.3.orig/src/c_wrapper.cpp id3lib-3.8.3/src/c_wrapper.cpp
--- id3lib-3.8.3.orig/src/c_wrapper.cpp	2017-12-15 22:04:20.642095449 -0600
+++ id3lib-3.8.3/src/c_wrapper.cpp	2017-12-15 22:05:06.617093119 -0600
@@ -681,6 +681,39 @@
     }
   }
 
+  ID3_C_EXPORT bool CCONV
+  ID3Field_SetEncoding(ID3Field *field, ID3_TextEnc enc)
+  {
+    bool changed = false;
+    if (field)
+    {
+      ID3_CATCH(changed = reinterpret_cast<ID3_Field *>(field)->SetEncoding(enc));
+    }
+    return changed;
+  }
+
+  ID3_C_EXPORT ID3_TextEnc CCONV
+  ID3Field_GetEncoding(const ID3Field *field)
+  {
+    ID3_TextEnc enc = ID3TE_NONE;
+    if (field)
+    {
+      ID3_CATCH(enc = reinterpret_cast<const ID3_Field *>(field)->GetEncoding());
+    }
+    return enc;
+  }
+
+  ID3_C_EXPORT bool CCONV
+  ID3Field_IsEncodable(const ID3Field *field)
+  {
+    bool isEncodable = false;
+    if (field)
+    {
+      ID3_CATCH(isEncodable = reinterpret_cast<const ID3_Field *>(field)->IsEncodable());
+    }
+    return isEncodable;
+  }
+
 #ifdef __cplusplus
 }
 #endif /* __cplusplus */
diff -Naur id3lib-3.8.3.orig/src/field.cpp id3lib-3.8.3/src/field.cpp
--- id3lib-3.8.3.orig/src/field.cpp	2017-12-15 22:04:20.642095449 -0600
+++ id3lib-3.8.3/src/field.cpp	2017-12-15 22:05:06.618093119 -0600
@@ -719,7 +719,7 @@
 // USER       ID3FID_TERMSOFUSE        Terms of use
 // USLT  ULT  ID3FID_UNSYNCEDLYRICS    Unsynchronized lyric/text transcription
 // WCOM  WCM  ID3FID_WWWCOMMERCIALINFO Commercial information
-// WCOP  WCM  ID3FID_WWWCOPYRIGHT      Copyright/Legal infromation
+// WCOP  WCM  ID3FID_WWWCOPYRIGHT      Copyright/Legal information
 // WOAF  WCP  ID3FID_WWWAUDIOFILE      Official audio file webpage
 // WOAR  WAF  ID3FID_WWWARTIST         Official artist/performer webpage
 // WOAS  WAR  ID3FID_WWWAUDIOSOURCE    Official audio source webpage
@@ -813,7 +813,7 @@
   {ID3FID_TERMSOFUSE,        ""   , "USER", false, false, ID3FD_TermsOfUse,    "Terms of use"},
   {ID3FID_UNSYNCEDLYRICS,    "ULT", "USLT", false, false, ID3FD_GeneralText,   "Unsynchronized lyric/text transcription"},
   {ID3FID_WWWCOMMERCIALINFO, "WCM", "WCOM", false, false, ID3FD_URL,           "Commercial information"},
-  {ID3FID_WWWCOPYRIGHT,      "WCP", "WCOP", false, false, ID3FD_URL,           "Copyright/Legal infromation"},
+  {ID3FID_WWWCOPYRIGHT,      "WCP", "WCOP", false, false, ID3FD_URL,           "Copyright/Legal information"},
   {ID3FID_WWWAUDIOFILE,      "WAF", "WOAF", false, false, ID3FD_URL,           "Official audio file webpage"},
   {ID3FID_WWWARTIST,         "WAR", "WOAR", false, false, ID3FD_URL,           "Official artist/performer webpage"},
   {ID3FID_WWWAUDIOSOURCE,    "WAS", "WOAS", false, false, ID3FD_URL,           "Official audio source webpage"},
diff -Naur id3lib-3.8.3.orig/src/header_tag.cpp id3lib-3.8.3/src/header_tag.cpp
--- id3lib-3.8.3.orig/src/header_tag.cpp	2017-12-15 22:04:20.642095449 -0600
+++ id3lib-3.8.3/src/header_tag.cpp	2017-12-15 22:05:06.618093119 -0600
@@ -54,7 +54,7 @@
 {
   size_t bytesUsed = ID3_TagHeader::SIZE;
 
-  if (_info->is_extended)
+  if (_info && _info->is_extended)
   {
     bytesUsed += _info->extended_bytes;
   }
diff -Naur id3lib-3.8.3.orig/src/io_helpers.cpp id3lib-3.8.3/src/io_helpers.cpp
--- id3lib-3.8.3.orig/src/io_helpers.cpp	2017-12-15 22:04:20.642095449 -0600
+++ id3lib-3.8.3/src/io_helpers.cpp	2017-12-15 22:05:06.618093119 -0600
@@ -363,11 +363,22 @@
     // 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;
 }
diff -Naur id3lib-3.8.3.orig/src/Makefile.am id3lib-3.8.3/src/Makefile.am
--- id3lib-3.8.3.orig/src/Makefile.am	2017-12-15 22:04:20.642095449 -0600
+++ id3lib-3.8.3/src/Makefile.am	2017-12-15 22:05:06.618093119 -0600
@@ -74,6 +74,8 @@
 
 if ID3_NEEDZLIB
 LDADD        = $(top_builddir)/zlib/src/libz.la
+else
+libid3_la_LIBADD  = -lz
 endif
 
 libid3_la_LDFLAGS = \
diff -Naur id3lib-3.8.3.orig/src/mp3_parse.cpp id3lib-3.8.3/src/mp3_parse.cpp
--- id3lib-3.8.3.orig/src/mp3_parse.cpp	2017-12-15 22:04:20.642095449 -0600
+++ id3lib-3.8.3/src/mp3_parse.cpp	2017-12-15 22:05:06.618093119 -0600
@@ -465,7 +465,7 @@
   // from http://www.xingtech.com/developer/mp3/
 
   const size_t VBR_HEADER_MIN_SIZE = 8;     // "xing" + flags are fixed
-  const size_t VBR_HEADER_MAX_SIZE = 116;   // frames, bytes, toc and scale are optional
+  const size_t VBR_HEADER_MAX_SIZE = 120;   // frames, bytes, toc and scale are optional
 
   if (mp3size >= vbr_header_offest + VBR_HEADER_MIN_SIZE) 
   {
diff -Naur id3lib-3.8.3.orig/src/tag_file.cpp id3lib-3.8.3/src/tag_file.cpp
--- id3lib-3.8.3.orig/src/tag_file.cpp	2017-12-15 22:04:20.642095449 -0600
+++ id3lib-3.8.3/src/tag_file.cpp	2017-12-15 22:05:06.618093119 -0600
@@ -242,8 +242,8 @@
     strcpy(sTempFile, filename.c_str());
     strcat(sTempFile, sTmpSuffix.c_str());
 
-#if ((defined(__GNUC__) && __GNUC__ >= 3  ) || !defined(HAVE_MKSTEMP))
-    // This section is for Windows folk && gcc 3.x folk
+#if !defined(HAVE_MKSTEMP)
+    // This section is for Windows folk
     fstream tmpOut;
     createFile(sTempFile, tmpOut);
 
@@ -257,7 +257,7 @@
       tmpOut.write((char *)tmpBuffer, nBytes);
     }
 
-#else //((defined(__GNUC__) && __GNUC__ >= 3  ) || !defined(HAVE_MKSTEMP))
+#else //!defined(HAVE_MKSTEMP)
 
     // else we gotta make a temp file, copy the tag into it, copy the
     // rest of the old file after the tag, delete the old file, rename
@@ -270,7 +270,7 @@
       //ID3_THROW_DESC(ID3E_NoFile, "couldn't open temp file");
     }
 
-    ofstream tmpOut(fd);
+    ofstream tmpOut(sTempFile);
     if (!tmpOut)
     {
       tmpOut.close();
@@ -285,14 +285,14 @@
     uchar tmpBuffer[BUFSIZ];
     while (file)
     {
-      file.read(tmpBuffer, BUFSIZ);
+      file.read((char *)tmpBuffer, BUFSIZ);
       size_t nBytes = file.gcount();
-      tmpOut.write(tmpBuffer, nBytes);
+      tmpOut.write((char *)tmpBuffer, nBytes);
     }
 
     close(fd); //closes the file
 
-#endif ////((defined(__GNUC__) && __GNUC__ >= 3  ) || !defined(HAVE_MKSTEMP))
+#endif ////!defined(HAVE_MKSTEMP)
 
     tmpOut.close();
     file.close();
