]> granicus.if.org Git - taglib/commitdiff
Don't include empty strings in the text field list. This is a slight deviation
authorScott Wheeler <wheeler@kde.org>
Thu, 19 Jul 2007 00:44:37 +0000 (00:44 +0000)
committerScott Wheeler <wheeler@kde.org>
Thu, 19 Jul 2007 00:44:37 +0000 (00:44 +0000)
from the standard, but major editors (i.e. iTunes) mess up ID3v2 text frames with
null termination (which technically indicates a field with content, plus an empty
field).

git-svn-id: svn://anonsvn.kde.org/home/kde/trunk/kdesupport/taglib@689739 283d02a7-25f6-0310-bc7c-ecb5cbfe19da

taglib/mpeg/id3v2/frames/textidentificationframe.cpp

index 3f7c7218177ef349503720917f42aef2805648cf..9a9eddee38b143264168bfb987f420f226d810aa 100644 (file)
@@ -126,8 +126,10 @@ void TextIdentificationFrame::parseFields(const ByteVector &data)
   // type is the same specified for this frame
 
   for(ByteVectorList::Iterator it = l.begin(); it != l.end(); it++) {
-    String s(*it, d->textEncoding);
-    d->fieldList.append(s);
+    if(!(*it).isEmpty()) {
+      String s(*it, d->textEncoding);
+      d->fieldList.append(s);
+    }
   }
 }