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 5514

Summary: Mix_LoadMUS() sometimes fails to return NULL on error in Timidity
Product: SDL_mixer Reporter: Ralph Versteegen <teeemcee>
Component: miscAssignee: Ryan C. Gordon <icculus>
Status: RESOLVED WONTFIX QA Contact: Sam Lantinga <slouken>
Severity: minor    
Priority: P2 CC: sezeroz
Version: unspecified   
Hardware: x86_64   
OS: Linux   

Description Ralph Versteegen 2021-01-29 00:58:23 UTC
Mix_LoadMUS() sometimes fails to return NULL even when there's an error in the Timidity backend. I was missing a "dir" path in timidity.cfg so MIDI didn't play, but Mix_LoadMUS returned non-NULL although Mix_GetError() returns "Couldn't open /etc/timidity/instruments/bagpipes.pat". Also, using SDL_SetHint("SDL_MIXER_DEBUG_MUSIC_INTERFACES", "1"), only "Loaded music with TIMIDITY" was printed.

On the other hand with other timidity.cfg problems like a bad "source" path, Mix_LoadMUS returns NULL, Mix_GetError returns "Couldn't open timidity.cfg", and the DEBUG_MUSIC_INTERFACES hint prints "Couldn't open TIMIDITY: Couldn't open timidity.cfg"

Present in latest hg revision.
Comment 1 Ralph Versteegen 2021-01-29 09:26:24 UTC
Timidity_LoadSong calls load_missing_instruments calls fillbank calls load_instrument, which eventually calls SDL_RWFromFile which calls SDL_SetError.
load_missing_instruments counts the number of errors (generally, instruments which couldn't be loaded) and returns this count to Timidity_LoadSong, which ignores it.

On some more thought, ignoring missing instrument errors is probably intentional, and it's probably too much bother to make Timidity_LoadSong fail if all the instruments failed to load. What do you think, WONTFIX?
Comment 2 Ozkan Sezer 2021-01-29 11:23:45 UTC
(In reply to Ralph Versteegen from comment #1)
>  ignoring missing instrument errors is probably
> intentional, and it's probably too much bother to make Timidity_LoadSong
> fail if all the instruments failed to load. What do you think, WONTFIX?

This looks like a WONTFIX to me.