From: Scott Wheeler Date: Tue, 26 Aug 2008 12:19:47 +0000 (+0000) Subject: Don't try to access the string list if the item type is a locator. X-Git-Tag: v1.6rc1~59 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=13fddc3974c43a88de9d26354d94b7ecd5429903;p=taglib Don't try to access the string list if the item type is a locator. Allan, does this look correct? (It at least fixes the crash...) BUG:169810 CCMAIL:kde@carewolf.com git-svn-id: svn://anonsvn.kde.org/home/kde/trunk/kdesupport/taglib@852712 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- diff --git a/taglib/ape/apeitem.cpp b/taglib/ape/apeitem.cpp index a6fe31b9..77a9ca01 100644 --- a/taglib/ape/apeitem.cpp +++ b/taglib/ape/apeitem.cpp @@ -160,14 +160,14 @@ String APE::Item::toString() const bool APE::Item::isEmpty() const { switch(d->type) { - case 0: - case 1: + case Text: + case Binary: if(d->text.isEmpty()) return true; if(d->text.size() == 1 && d->text.front().isEmpty()) return true; return false; - case 2: + case Locator: return d->value.isEmpty(); default: return false; @@ -206,8 +206,9 @@ ByteVector APE::Item::render() const if(isEmpty()) return data; - if(d->type != Item::Binary) { + if(d->type == Text) { StringList::ConstIterator it = d->text.begin(); + value.append(it->data(String::UTF8)); it++; for(; it != d->text.end(); ++it) {