Verify that an APE text item isn't empty before use
authorStephen F. Booth <me@sbooth.org>
Thu, 12 Apr 2012 14:53:32 +0000 (10:53 -0400)
committerStephen F. Booth <me@sbooth.org>
Thu, 12 Apr 2012 14:53:32 +0000 (10:53 -0400)
taglib/ape/apeitem.cpp

index 1e60bc52f8b4b0d7121bc29216fb0a4154dee45b..ac0e26ed02b5a11863bdeb788bacd6ebd429b580 100644 (file)
@@ -170,15 +170,15 @@ int APE::Item::size() const
   int result = 8 + d->key.size() /* d->key.data(String::UTF8).size() */ + 1;
   switch (d->type) {
     case Text:
-      {
+      if(d->text.size()) {
         StringList::ConstIterator it = d->text.begin();
                  
         result += it->data(String::UTF8).size();
         it++;
         for(; it != d->text.end(); ++it)
           result += 1 + it->data(String::UTF8).size();
-        break;
       }
+      break;
 
     case Binary:
     case Locator: