audiocogs / jsmad

Deprecated. Please use mp3.js.

Home Page:https://github.com/audiocogs/mp3.js

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

frames.js - crc skip/check at wrong offset

showstopper opened this issue · comments

Refering to https://github.com/ofmlabs/jsmad/blob/master/src/frame.js#L111

Specs says that the 16-bit crc comes after the frame header. Therefore the skip should be located at https://github.com/ofmlabs/jsmad/blob/master/src/frame.js#L172.

So... test case + patch? :)

As you can see, jsmad (possibly libmad too) skips the crc check anyway, and it's skipped somewhere so it possibly doesn't corrupt decoding that much.

@nddrylliog Actually, if I understood this correctly, the rest of the header decoding is completely flawed if crc-protection is on. (Correct me if I'm wrong). I'll add test-patch later this evening (currently busy with exchanging presents and stuff)