Menu

#24 loop if no V2 tag and saving one

open
nobody
None
5
2002-12-08
2002-12-08
No

If file does not have a V2 Tag saving one results in loop.

Since the variable "writtenTagSize", in ID3v2TAG is 0
if there is no v2 tag and this variable is used in a
loop to increase the size of the header until it is big
enough this results in a indefinite loop.

The loop is in method getUpdatedPadding()

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

and writtenTagSize is zero ....

fix:
if (writtenTagSize <=0) .....

Discussion

  • Ryan W Sims

    Ryan W Sims - 2003-05-30

    Logged In: YES
    user_id=205101

    I've just recently been playing around with this library and
    ran into this problem, just did this:
    if(writtenTagSize <=0) { writtenTagSize=2;}
    arbitrarily.

     
  • Ron Smits

    Ron Smits - 2004-03-15

    Logged In: YES
    user_id=215617

    Hmmz do not play with writtenTagSize as it is a calculated
    value from the file itself.

    Play with newTagSize so other routines that decide based on
    writtenTagSize have the correct information

     

Log in to post a comment.