1
1
mirror of https://github.com/wader/fq.git synced 2024-10-04 23:48:00 +03:00

id3v2: Should assert not validate magic

Fixes issue with mp3 frame that happens to have a 2,3 or 4 at byte 3 being seen as id3v2 header
This commit is contained in:
Mattias Wadman 2022-01-22 16:13:13 +01:00
parent 49c90f89b2
commit 85371173b5

View File

@ -577,7 +577,7 @@ func decodeFrames(d *decode.D, version int, size uint64) {
func id3v2Decode(d *decode.D, in interface{}) interface{} {
d.AssertAtLeastBitsLeft(4 * 8)
d.FieldUTF8("magic", 3, d.ValidateStr("ID3"))
d.FieldUTF8("magic", 3, d.AssertStr("ID3"))
version := int(d.FieldU8("version"))
versionValid := version == 2 || version == 3 || version == 4
if !versionValid {