From 8d2d88f4d0c95af3cbac58408506496ae0b5ab47 Mon Sep 17 00:00:00 2001 From: Mattias Wadman Date: Tue, 25 Jan 2022 16:02:07 +0100 Subject: [PATCH] mp3: Decrease max sync seek length between frames to 4k This might break mp3s with large id3v2 chunks embedded into the stream but i think that is rare and probably means it is a dump of a mp3 radio stream etc. An alternative approach is to also look for id3v2 etc between frames but then the mp3 root value probably should be an array of mix of things instead of a struct, or rename header/footer to metadata? Related to #103 --- format/mp3/mp3.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/format/mp3/mp3.go b/format/mp3/mp3.go index 2ed5584c..ae596a0c 100644 --- a/format/mp3/mp3.go +++ b/format/mp3/mp3.go @@ -16,7 +16,7 @@ var mp3Frame decode.Group // TODO: format options default const maxUniqueHeaderConfigs = 5 -const maxSyncSeek = 64 * 1024 * 8 +const maxSyncSeek = 4 * 1024 * 8 func init() { registry.MustRegister(decode.Format{