Fix ID3v2 padding size calculation.

This commit is contained in:
Tsuda Kageyu 2014-12-09 10:54:21 +09:00
parent d80c4c96c3
commit 1a917a38cd

View File

@ -608,9 +608,11 @@ ByteVector ID3v2::Tag::render(int version) const
// Padding won't increase beyond 1% of the file size.
const uint threshold = d->file->length() / 100; // should be ulonglong in taglib2.
if(paddingSize > d->paddingSize && paddingSize > threshold)
paddingSize = DefaultPaddingSize;
if(paddingSize > DefaultPaddingSize) {
const uint threshold = d->file->length() / 100; // should be ulonglong in taglib2.
if(paddingSize > threshold)
paddingSize = DefaultPaddingSize;
}
}
tagData.append(ByteVector(paddingSize, '\0'));