Genre tags: read multi-value frames correctly, and repair existing rows #120

Merged
bvandeusen merged 2 commits from dev into main 2026-08-05 22:10:41 -04:00
Showing only changes of commit fd27819cdd - Show all commits
+3 -3
View File
@@ -141,10 +141,10 @@ func findGenreFrame(body []byte, major byte) ([]string, error) {
// the reverse) yields a plausible-looking wrong offset rather than an obvious // the reverse) yields a plausible-looking wrong offset rather than an obvious
// error, which is exactly how frame-walking bugs go unnoticed. // error, which is exactly how frame-walking bugs go unnoticed.
func frameSize(b []byte, major byte) int { func frameSize(b []byte, major byte) int {
switch { switch major {
case major == 2: case 2:
return int(b[0])<<16 | int(b[1])<<8 | int(b[2]) return int(b[0])<<16 | int(b[1])<<8 | int(b[2])
case major == 3: case 3:
n := binary.BigEndian.Uint32(b) n := binary.BigEndian.Uint32(b)
if n > maxID3TagSize { if n > maxID3TagSize {
return -1 return -1