]> granicus.if.org Git - taglib/commitdiff
Remove possible cross binary boundary delete
authortsuda.kageyu@gmail.com <Tsuda Kageyu>
Thu, 23 Aug 2012 02:09:22 +0000 (11:09 +0900)
committertsuda.kageyu@gmail.com <Tsuda Kageyu>
Thu, 23 Aug 2012 02:09:22 +0000 (11:09 +0900)
taglib/mpeg/id3v1/id3v1tag.cpp
taglib/mpeg/id3v1/id3v1tag.h

index 94d533aeea838fc425de2c24a505a03fb3a62656..e9eb47bf1f897abee03a3f926908f1642d81a8d0 100644 (file)
@@ -194,10 +194,10 @@ void ID3v1::Tag::setTrack(uint i)
 
 void ID3v1::Tag::setStringHandler(const StringHandler *handler)
 {
-  if(TagPrivate::stringHandler != &defaultStringHandler)
-    delete TagPrivate::stringHandler;
-
-  TagPrivate::stringHandler = handler;
+  if (handler)
+    TagPrivate::stringHandler = handler;
+  else
+    TagPrivate::stringHandler = &defaultStringHandler;
 }
 
 ////////////////////////////////////////////////////////////////////////////////
index a90ac531f912be9da4e369c1854e2cd06c12c1f7..ad3fed99f3fd1154dd1fd28d224750ce807e7e40 100644 (file)
@@ -154,6 +154,8 @@ namespace TagLib {
       /*!
        * Sets the string handler that decides how the ID3v1 data will be
        * converted to and from binary data.
+       * If the parameter \a handler is null, default ISO-8859-1 handler
+       * is restored.
        *
        * \see StringHandler
        */