Menu

#41 endless loop in Id3V2.getUpdatePadding

open
nobody
None
5
2004-03-15
2004-03-15
Ron Smits
No

There is the rare occurrence where an mp3 file will
have Id3V2 compliant padding but no Id3V2 tags. This
will cause the getupdatedPadding method to enter an
endless loop if the new tag is smaller then padding here:

while (newTagSize < size) {
newTagSize += writtenTagSize;
}

Solution is to add before the while loop a test for
writtenTagSize == 0 like this:

if (writtenTagSize == 0) {
newTagSize = sizeDiff * 2;
}

The multiplier by 2 is to make some room :)

Discussion


Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.