The CRC calculation of MPEG v1.0 layer 2 files fails due to a wrong length calculation. The data length used for CRC is based on a too simple calculation, see id3lib-3.8.3/src/mp3_parse.cpp, line ~425 - this gives a constant value only, which is unfortunately wrong for layer 2 files.
To reproduce: take some 16 bit 44.1kHz stereo wav file and convert it with the encoder "twolame --protect <infile> <outfile>"
For your reference: the implementations of libmad (layer12.c, lines 331...430) or the tool "checkmate" (see mpck/layer2.c) do some complex crc length calculations for layer2 files.
Log in to post a comment.