TagLib crash in STL due to append of zero-length GEOB filename

Michael Pyne michael.pyne at kdemail.net
Sun May 27 01:00:53 CEST 2007


On Saturday 26 May 2007, David Lasker wrote:
> I'm a bit of a newbie to ID3 and TagLib, so if there is something I can do
> in my code to avoid this problem please let me know. Otherwise could some
> kind soul apply this patch (corrected if necessary) to the repository?

Fixed in revision 668610 (but please test)

Index: tbytevector.cpp
===================================================================
--- tbytevector.cpp     (revision 668609)
+++ tbytevector.cpp     (working copy)
@@ -432,6 +432,9 @@

 ByteVector &ByteVector::append(const ByteVector &v)
 {
+  if(v.d->size == 0)
+    return *this; // Simply return if appending nothing.
+
   detach();

   uint originalSize = d->size;

Regards,
 - Michael Pyne


More information about the taglib-devel mailing list