larsbs / id3v2lib

id3v2lib is a library written in C to read and edit id3 tags from mp3 files.
BSD 2-Clause "Simplified" License
128 stars 44 forks source link

mangled tags #28

Closed themaddoctor closed 1 year ago

themaddoctor commented 6 years ago

When the altered file is read with id3v2 -l, title has "ng " prepended. album has first two characters missing. album artist has first character missing. disk number is blank

A hexdump shows that the full strings are present, so it must be a problem writing the frame lengths.

themaddoctor commented 6 years ago

Test data:

artist:         Artist Name
title:          Song Title
album:          Name of Album
album artist:   Album Artist
disk:           01
track:          99
date:           2018
genre:          rock
comment:

(No comment because of a runtime error with free().)

But:

> id3v2 -l test
id3v2 tag info for test:
TPE1 (Lead performer(s)/Soloist(s)): Artist Name
TIT2 (Title/songname/content description): ng Title
TALB (Album/Movie/Show title): me of Album
TPE2 (Band/orchestra/accompaniment): lbum Artist
TPOS (Part of a set):
TRCK (Track number/Position in set): 99
TYER (Year): 2018
TCON (Content type): rock (255)
themaddoctor commented 6 years ago
hexdump -C test
00000000  49 44 33 03 00 00 00 00  11 12 54 50 45 31 00 00  |ID3.......TPE1..|
00000010  00 0c 00 00 00 41 72 74  69 73 74 20 4e 61 6d 65  |.....Artist Name|
00000020  54 49 54 32 00 00 00 0b  4e 61 00 53 6f 6e 67 20  |TIT2....Na.Song |
00000030  54 69 74 6c 65 54 41 4c  42 00 00 00 0e 74 6c 00  |TitleTALB....tl.|
00000040  4e 61 6d 65 20 6f 66 20  41 6c 62 75 6d 54 50 45  |Name of AlbumTPE|
00000050  32 00 00 00 0d 20 41 00  41 6c 62 75 6d 20 41 72  |2.... A.Album Ar|
00000060  74 69 73 74 54 50 4f 53  00 00 00 03 72 74 00 30  |tistTPOS....rt.0|
00000070  31 54 52 43 4b 00 00 00  03 00 00 00 39 39 54 59  |1TRCK.......99TY|
00000080  45 52 00 00 00 05 00 00  00 32 30 31 38 54 43 4f  |ER.......2018TCO|
00000090  4e 00 00 00 05 00 00 00  72 6f 63 6b 00 00 00 00  |N.......rock....|
000000a0  00 00 00 00 00 00 00 00  00 00 00 00 00 00 00 00  |................|
*
00000890  00 00 00 00 00 00 00 00  00 00 00 00              |............|