Invalid ID3v2.4.0 frames without synchsafe integers are generated

Bug #1300323 reported by Urs Fleisch
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
lrcShow-X
New
Undecided
Unassigned

Bug Description

 lrcShow-X_2_1_1.tar.bz2
Ubuntu 13.10
Python 2.7.5+ (default, Feb 27 2014, 19:39:55)
audacious 3.4-1

First thanks for lrcShow-X, finally an application for synchronized lyrics which works on Linux!
lrcShow-X is generating invalid ID3v2.4.0 tags. ID3v2.4.0 stores the frame size as a 32 bit synchsafe integer. ID3v2.3.0 does not use synchsafe integers. lrcShow-X does not seem to use synchsafe integers.

How to reproduce:

# Create an MP3 with silence
dd if=/dev/zero bs=1M count=4 | lame -r - - >test.mp3
# Add an ID3v2.4.0 tag with artist and title
kid3-cli -c "set artist 'Def Leppard'" -c "set title 'Love Bites'" -c save -c to24 test.mp3

Now start lrcShow-X.py, select audacious, play test.mp3, searching on tuneWiki, wait until LRC is found, use "Other functions/Write lrc into media file" to create a SYLT frame.

Test the modified file using "MP3 Diags":
Invalid ID3V2.4.0 frame. Frame size is supposed to be stored as a synchsafe integer, which uses only 7 bits in a byte, but the size uses all 8 bits, as in ID3V2.3.0. This will confuse some applications

xxd test.mp3 | head
0000000: 4944 3304 0000 0000 176d 5450 4531 0000 ID3......mTPE1..
0000010: 000d 0000 0044 6566 204c 6570 7061 7264 .....Def Leppard
0000020: 0054 4954 3200 0000 0c00 0000 4c6f 7665 .TIT2.......Love
0000030: 2042 6974 6573 0053 594c 5400 0009 b600 Bites.SYLT.....
0000040: 0001 656e 6702 01ff fe53 0079 006c 0074 ..eng....S.y.l.t
0000050: 0020 0077 0072 0069 0074 0074 0065 006e . .w.r.i.t.t.e.n
0000060: 0020 0062 0079 0020 006c 0072 0063 0053 . .b.y. .l.r.c.S
0000070: 0068 006f 0077 002d 0049 0049 0000 0049 .h.o.w.-.I.I...I
0000080: 0066 0020 0059 006f 0075 0027 0076 0065 .f. .Y.o.u.'.v.e
0000090: 0020 0047 006f 0074 0020 004c 006f 0076 . .G.o.t. .L.o.v

Here the frame size bytes are 00 00 09 b6, which is not a synchsafe integer, see http://id3.org/id3v2.4.0-structure, sections 4 and 6.2. The correct synchsafe encoding would be 00 00 13 36.

After changing these bytes using a hex editor, "MP3 Diags" does no longer complain.

xxd test-correct.mp3 | head
0000000: 4944 3304 0000 0000 176d 5450 4531 0000 ID3......mTPE1..
0000010: 000d 0000 0044 6566 204c 6570 7061 7264 .....Def Leppard
0000020: 0054 4954 3200 0000 0c00 0000 4c6f 7665 .TIT2.......Love
0000030: 2042 6974 6573 0053 594c 5400 0013 3600 Bites.SYLT...6.
0000040: 0001 656e 6702 01ff fe53 0079 006c 0074 ..eng....S.y.l.t
0000050: 0020 0077 0072 0069 0074 0074 0065 006e . .w.r.i.t.t.e.n
0000060: 0020 0062 0079 0020 006c 0072 0063 0053 . .b.y. .l.r.c.S
0000070: 0068 006f 0077 002d 0049 0049 0000 0049 .h.o.w.-.I.I...I
0000080: 0066 0020 0059 006f 0075 0027 0076 0065 .f. .Y.o.u.'.v.e
0000090: 0020 0047 006f 0074 0020 004c 006f 0076 . .G.o.t. .L.o.v

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.