Issue Details (XML | Word | Printable)

Key: JAUDIOTAGGER-392
Type: Bug Bug
Status: Open Open
Priority: Major Major
Assignee: Unassigned
Reporter: TemporaryUser-_-
Votes: 0
Watchers: 1
Operations

If you were logged in you would be able to see more operations.
jaudiotagger

NumberFormatException thrown on certain fields

Created: 16/Oct/11 05:19 PM   Updated: 10/Dec/11 04:14 PM
Component/s: None
Affects Version/s: current
Fix Version/s: None

Time Tracking:
Not Specified

Environment:

Ubuntu 10.04 (Lucid)
Linux lapator 2.6.32-34-generic x86_64 GNU/Linux
java version "1.6.0_20"
OpenJDK Runtime Environment (IcedTea6 1.9.9) (6b20-1.9.9-0ubuntu1~10.04.2)
OpenJDK 64-Bit Server VM (build 19.0-b09, mixed mode)


Tags: exception
Participants: paultaylor and TemporaryUser-_-


 Description  « Hide

When parsing files with tag fields that are supposed to contain numbers, if a number is too big or a number isn't in the field unsuspecting developers won't watch that exception (java.lang.NumberFormatException).



paultaylor added a comment - 07/Dec/11 12:42 PM

More informatation, exact stack traces would be useful.


TemporaryUser-_- added a comment - 10/Dec/11 04:14 PM

The issue is fairly easy to reproduce. Take any mp3 file, write a number bigger than the system's Integer.MAX_VALUE and let jaudiotagger loose on it.

Below is my stack trace:
GRAVE: Brokencyde - Sex Toyz.mp3:An error occurred within abstractID3v2FrameBody for identifier:TRCK:For input string: "99999999999999"
Exception in thread "main" java.lang.NumberFormatException: For input string: "99999999999999"
at java.lang.NumberFormatException.forInputString(NumberFormatException.java:65)
at java.lang.Integer.parseInt(Integer.java:484)
at java.lang.Integer.parseInt(Integer.java:514)
at org.jaudiotagger.tag.datatype.PartOfSet$PartOfSetValue.<init>(PartOfSet.java:218)
at org.jaudiotagger.tag.datatype.PartOfSet.readByteArray(PartOfSet.java:97)
at org.jaudiotagger.tag.id3.framebody.AbstractID3v2FrameBody.read(AbstractID3v2FrameBody.java:181)
at org.jaudiotagger.tag.id3.framebody.AbstractID3v2FrameBody.<init>(AbstractID3v2FrameBody.java:81)
at org.jaudiotagger.tag.id3.framebody.FrameBodyTRCK.<init>(FrameBodyTRCK.java:98)
at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:57)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:532)
at org.jaudiotagger.tag.id3.AbstractID3v2Frame.readBody(AbstractID3v2Frame.java:272)
at org.jaudiotagger.tag.id3.ID3v24Frame.read(ID3v24Frame.java:644)
at org.jaudiotagger.tag.id3.ID3v24Frame.<init>(ID3v24Frame.java:327)
at org.jaudiotagger.tag.id3.ID3v24Tag.readFrames(ID3v24Tag.java:900)
at org.jaudiotagger.tag.id3.ID3v24Tag.read(ID3v24Tag.java:873)
at org.jaudiotagger.tag.id3.ID3v24Tag.<init>(ID3v24Tag.java:605)
at org.jaudiotagger.audio.mp3.MP3File.readV2Tag(MP3File.java:208)
at org.jaudiotagger.audio.mp3.MP3File.<init>(MP3File.java:391)
at org.jaudiotagger.audio.mp3.MP3FileReader.read(MP3FileReader.java:39)
at org.jaudiotagger.audio.AudioFileIO.readFile(AudioFileIO.java:286)
at org.jaudiotagger.audio.AudioFileIO.read(AudioFileIO.java:150)
at net.sourceforge.deathgorepain.sound.JAudioTaggerTesting.main(JAudioTaggerTesting.java:61)

Cheers !