Fixed broken image issue in taglib
authorNikolay Tischenko <niktischenko@gmail.com>
Sun, 7 Nov 2010 18:31:16 +0000 (00:31 +0600)
committerNikolay Tischenko <niktischenko@gmail.com>
Sun, 7 Nov 2010 18:31:16 +0000 (00:31 +0600)
src/taglib/mpeg/id3v2/frames/attachedpictureframe.cpp

index a763e18..cd58360 100644 (file)
@@ -133,7 +133,7 @@ void AttachedPictureFrame::parseFields(const ByteVector &data)
 
   d->textEncoding = String::Type(data[0]);
 
-  int pos = 1;
+  int pos = 1, poss = 1;
 
   d->mimeType = readStringField(data, String::Latin1, &pos);
   /* Now we need at least two more bytes available */  
@@ -143,9 +143,11 @@ void AttachedPictureFrame::parseFields(const ByteVector &data)
   }
 
   d->type = (TagLib::ID3v2::AttachedPictureFrame::Type)data[pos++];
+
+  poss = pos;
   d->description = readStringField(data, d->textEncoding, &pos);
 
-  d->data = data.mid(pos);
+  d->data = data.mid(poss);
 }
 
 ByteVector AttachedPictureFrame::renderFields() const