From a25e1e9f90af82d3c925ef806cb76e35624a0f41 Mon Sep 17 00:00:00 2001 From: Tsuda Kageyu Date: Fri, 13 Nov 2015 11:44:12 +0900 Subject: [PATCH] Correct the ID3v2 padding size calculation. --- taglib/mpeg/id3v2/id3v2tag.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/taglib/mpeg/id3v2/id3v2tag.cpp b/taglib/mpeg/id3v2/id3v2tag.cpp index de8872f1..e41606db 100644 --- a/taglib/mpeg/id3v2/id3v2tag.cpp +++ b/taglib/mpeg/id3v2/id3v2tag.cpp @@ -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;