]> granicus.if.org Git - taglib/commitdiff
Correct the ID3v2 padding size calculation.
authorTsuda Kageyu <tsuda.kageyu@gmail.com>
Fri, 13 Nov 2015 02:44:12 +0000 (11:44 +0900)
committerTsuda Kageyu <tsuda.kageyu@gmail.com>
Fri, 13 Nov 2015 02:44:12 +0000 (11:44 +0900)
taglib/mpeg/id3v2/id3v2tag.cpp

index de8872f1fd1ad9ac8ce14c1a50e1b214cce9147d..e41606db462f066eff86adb35e65ad8dfa619ada 100644 (file)
@@ -619,7 +619,7 @@ ByteVector ID3v2::Tag::render(int version) const
   // Compute the amount of padding, and append that to tagData.
   // TODO: Should be calculated in offset_t in taglib2.
 
-  long paddingSize = d->header.tagSize() - tagData.size();
+  long paddingSize = d->header.tagSize() - (tagData.size() - Header::size());
 
   if(paddingSize <= 0) {
     paddingSize = MinPaddingSize;