]> granicus.if.org Git - taglib/commitdiff
Don't try to access the string list if the item type is a locator.
authorScott Wheeler <wheeler@kde.org>
Tue, 26 Aug 2008 12:19:47 +0000 (12:19 +0000)
committerScott Wheeler <wheeler@kde.org>
Tue, 26 Aug 2008 12:19:47 +0000 (12:19 +0000)
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

taglib/ape/apeitem.cpp

index a6fe31b9ff3d706be3cbc2630bec65b1debc7554..77a9ca018729b3171eef5754111125d4aaccdc61 100644 (file)
@@ -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) {