Menu

#27 Array out of bound exception when ID3v2 tag size gets bigger

open
Tech
None
5
2003-07-10
2003-02-05
Anonymous
No

This bug occurs when jd2lib needs to increase the size
of ID3V2 tag.

Array out of bound exception is thrown.

So the bug is in the file
ID3v2Tag.java : 348
byte[] b = new byte[getTotalSize()];

the line itself is not a bug, but it need to be at a different
place

the code snippet ...
byte[] b = new byte[getTotalSize()];
int bytesCopied = 0;
int length = 0;
padding = getUpdatedPadding();

should be

int bytesCopied = 0;
int length = 0;
padding = getUpdatedPadding();
byte[] b = new byte[getTotalSize()];

problem is that getUpdatedPadding() can increase the
size of the file. If size of file is picked up before the its
increased. Then that size is used to later on and it
causes the arrayOutOfBoundException.

Pritpal Dhaliwal

Discussion

  • Nobody/Anonymous

    Logged In: NO

    I'm having the same problem. I modified my version with the
    code you provided and that seems to have fixed it.

    Any chance this fix will go into a distributed version?

     
  • Tech

    Tech - 2003-07-10

    Logged In: YES
    user_id=631729

    Thank you both for your feedback. This will be changed in
    next version.

     
  • Tech

    Tech - 2003-07-10
    • assigned_to: nobody --> grotaiche
     
  • Ron Smits

    Ron Smits - 2004-02-26

    Logged In: YES
    user_id=215617

    This is the same solution I found. (bug 901909)

     

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.