We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 4728

Summary: music_mad.c: better skipping of tags:
Product: SDL_mixer Reporter: Ozkan Sezer <sezeroz>
Component: miscAssignee: Ozkan Sezer <sezeroz>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2    
Version: unspecified   
Hardware: All   
OS: All   
Attachments: music_mad.c patch for SDL2_mixer
music_mad.c patch for SDL2_mixer
music_mad.c patch for SDL_mixer-1.2

Description Ozkan Sezer 2019-07-20 23:00:09 UTC
Created attachment 3888 [details]
music_mad.c patch for SDL2_mixer

music_mad.c: better skipping of tags:

Instead of doing it 'as-we-go' every time, skip the tags at file-open
time only once.

The former implementation had the chance of not having the full tag in
the frame, that includes a possibility of even not having the complete
tag magic in the frame leading to not identifying a tag.

The new implementation skips all the tags at file-start and file-end,
and does that only once. That requires some local file data-start and
file-end bookkeeping for SDL_RWops which are added.

Also added are detection and skipping of extended ID3v1 and APEv1 tags.



OK to apply?  (Can easily backport to SDL-1.2 too.)
Comment 1 Ozkan Sezer 2019-07-21 09:53:50 UTC
Created attachment 3889 [details]
music_mad.c patch for SDL2_mixer

Slightly simplified patch.
Comment 2 Ozkan Sezer 2019-07-21 09:54:35 UTC
Created attachment 3890 [details]
music_mad.c patch for SDL_mixer-1.2

SDL-1.2 version of the patch.
Comment 3 Sam Lantinga 2019-07-23 00:06:55 UTC
Yup, this looks good to commit.
Comment 4 Ozkan Sezer 2019-07-23 07:39:59 UTC
Applied. SDL-1.2: http://hg.libsdl.org/SDL_mixer/rev/1f6c6389391a
default-2.0: http://hg.libsdl.org/SDL_mixer/rev/4e7795a92332