Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

dv.getUint8(i) Index out of range #9

Open
bmoore opened this issue Feb 18, 2014 · 3 comments
Open

dv.getUint8(i) Index out of range #9

bmoore opened this issue Feb 18, 2014 · 3 comments

Comments

@bmoore
Copy link

bmoore commented Feb 18, 2014

node_modules/id3js/dist/id3.js:696

if(dv.getUint8(i) === 0x00) {
      ^
Error: Index out of range.
    at Object.ID3Frame.parse (./node_modules/id3js/dist/id3.js:696:13)

I can repeat this with one mp3 I have. I'm currently trying to figure out what in the mp3 is failing.

@bmoore
Copy link
Author

bmoore commented Feb 18, 2014

Wrapping

frame = ID3Frame.parse(slice, tags.v2.version[0]);

with

try {
  frame = ID3Frame.parse(slice, tags.v2.version[0]);
} catch (e) {
  console.log(e, frame);
}

I was able to get

[Error: Index out of range.] { tag: 'comments',
  value: ' 000004C8 0000043F 00002C5A 00002E8F 0001513E 0001513E 0000832C 0000829E 00019D43 000148C6\u0000' }

When I inspected the id3v2 tags, I found the COMM tags

$ id3v2 -l fail.mp3 | grep COMM
COMM (Comments): (iTunPGAP)[eng]: 0
COMM (Comments): (iTunNORM)[eng]:  000004C8 0000043F 00002C5A 00002E8F 0001513E 0001513E 0000832C 0000829E 00019D43 000148C6
COMM (Comments): (iTunSMPB)[eng]:  00000000 00000210 0000073D 0000000000C635B3 00000000 00B3B000 00000000 00000000 00000000 00000000 00000000 00000000
COMM (Comments): ()[eng]: Static Caravan Recordings (VAN 194), released 07/20/2009.

So there is some issue with the iTunNORM comment.
As I stripped the COMM tags completely, the tags were parsed correctly.

Also, the tags seemed to be parsed fine with the try catch in place.

@43081j
Copy link
Owner

43081j commented Feb 23, 2014

Could you possibly find it in a hex editor starting with and including "COMM" (43 4F 4D 4D) and paste the block here (until the next tag name)?

This looks like it'd happen if the comment in question has no 0x00 between the short/long comment text.

@Captainlonate
Copy link

I'm having this problem too. Is there no fix?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants