--- taglib/mpc/mpcproperties.cpp 2004/09/09 00:28:57 345141 +++ taglib/mpc/mpcproperties.cpp 2005/04/02 20:53:11 402712 @@ -106,7 +106,7 @@ void MPC::Properties::read() { - if(d->data.mid(0, 3) != "MP+") + if(!d->data.startsWith("MP+")) return; d->version = d->data[3] & 15; @@ -116,7 +116,7 @@ if(d->version >= 7) { frames = d->data.mid(4, 4).toUInt(false); - std::bitset<32> flags = d->data.mid(8, 4).toUInt(true); + std::bitset<32> flags = d->data.mid(8, 4).toUInt(false); d->sampleRate = sftable[flags[17] * 2 + flags[16]]; d->channels = 2; } --- taglib/mpc/mpcfile.cpp 2004/09/02 18:50:26 343576 +++ taglib/mpc/mpcfile.cpp 2005/04/03 16:41:17 402896 @@ -53,7 +53,10 @@ ~FilePrivate() { + if (tag != ID3v1Tag && tag != APETag) delete tag; delete ID3v1Tag; + delete APETag; + delete ID3v2Header; delete properties; } @@ -227,7 +230,7 @@ if(d->APETag) d->tag = d->APETag; else - d->tag = d->APETag = new APE::Tag(); + d->tag = d->APETag = new APE::Tag; } if(tags & ID3v2) { @@ -242,7 +245,7 @@ if(d->ID3v1Tag) d->tag = d->ID3v1Tag; else - d->tag = d->APETag = new APE::Tag(); + d->tag = d->APETag = new APE::Tag; } } @@ -284,7 +287,7 @@ if(d->hasAPE) d->tag = d->APETag; else - d->tag = d->APETag = new APE::Tag(); + d->tag = d->APETag = new APE::Tag; } } --- taglib/ape/apeitem.h 2004/11/06 14:24:40 360969 +++ taglib/ape/apeitem.h 2005/04/03 16:35:55 402891 @@ -70,6 +70,11 @@ Item(const Item &item); /*! + * Destroys the item. + */ + virtual ~Item(); + + /*! * Copies the contents of \a item into this item. */ Item &operator=(const Item &item); --- taglib/ape/apeitem.cpp 2004/11/06 14:43:24 360973 +++ taglib/ape/apeitem.cpp 2005/04/03 16:35:55 402891 @@ -62,6 +62,11 @@ d = new ItemPrivate(*item.d); } +APE::Item::~Item() +{ + delete d; +} + Item &APE::Item::operator=(const Item &item) { delete d; @@ -111,7 +116,7 @@ String APE::Item::toString() const { - return d->text.front(); + return isEmpty() ? String::null : d->text.front(); } bool APE::Item::isEmpty() const @@ -121,7 +126,7 @@ case 1: if(d->text.isEmpty()) return true; - if(d->text.size() == 1 && d->text.front() == "") + if(d->text.size() == 1 && d->text.front().isEmpty()) return true; return false; case 2: