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 3898

Summary: multiple timidity fixes
Product: SDL_mixer Reporter: Ozkan Sezer <sezeroz>
Component: miscAssignee: Ryan C. Gordon <icculus>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2    
Version: unspecified   
Hardware: All   
OS: All   
Attachments: patch01
patch02
patch03
patch04
patch05
patch06

Description Ozkan Sezer 2017-10-21 09:36:48 UTC
Attached patches apply fixes to timidity.
Comment 1 Ozkan Sezer 2017-10-21 09:37:33 UTC
Created attachment 3015 [details]
patch01

load_instrument(): Close the file before returning in error cases.
Comment 2 Ozkan Sezer 2017-10-21 09:38:12 UTC
Created attachment 3016 [details]
patch02

fix a few clang -Wempty-body warnings.
Comment 3 Ozkan Sezer 2017-10-21 09:38:55 UTC
Created attachment 3017 [details]
patch03

instrum.c (load_instrument): Fix shadowing warnings due to reuse of variables i and tmp.
Comment 4 Ozkan Sezer 2017-10-21 09:39:29 UTC
Created attachment 3018 [details]
patch04

allocate the sp data with two additional samples in instrum.c,
initialize the extra to 0. apply the timidity-0.2i-bugfix.pat
patch found at the onicos.com site.  apply a lot of resampler
fixes.  fixes all the valgrind warnings reported in bug #3892.
Comment 5 Ozkan Sezer 2017-10-21 09:41:02 UTC
Created attachment 3019 [details]
patch05

resample.c (rs_plain): Bug fixed about PRECALC_LOOPS counter.
Original form: i = (le - ofs) / incr + 1;           (Original)
Fixed form:    i = (le - ofs + incr - 1) / incr;    (Correct)
[ from timidity++ v2.7.0-to-v2.8.0 diff, 1999-11-19  Masanao Izumo <mo@goice.co.jp> ]
Comment 6 Ozkan Sezer 2017-10-21 09:41:43 UTC
Created attachment 3020 [details]
patch06

further resampler fixes to avaid crashes (e.g. in rs_loop) with broken situations.
Comment 7 Sam Lantinga 2017-10-21 09:53:56 UTC
Added, thanks!