Skip to content

Commit

Permalink
Date: Sat, 18 Aug 2007 12:53:35 -0700
Browse files Browse the repository at this point in the history
From: Brandon
Subject: An old bug in SDL-mixer.

The bug occurs when the following happens:
1) load a mod file (#1) with x channels.
2) load a mod file (#2) with ( > x) channels
3) Try to play modfile #1. SDL-mixer causes the app to segfault.

Note that this is not 100% reproducable. You can read a more detailed
report here: http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=422021

There is good news. I still have the patch. I checked, and it still
works against the latest version. I have included a patch that I just
created against the latest sdl-mixer version 1.2.8.
  • Loading branch information
slouken committed Aug 18, 2007
1 parent 5380ffa commit 8835542
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions mikmod/mplayer.c
Expand Up @@ -1896,7 +1896,7 @@ void pt_UpdateVoices(int max_volume)
SAMPLE *s;

pf->totalchn=pf->realchn=0;
for (mp_channel=0;mp_channel<md_sngchn;mp_channel++) {
for (mp_channel=0;mp_channel<pf->numchn;mp_channel++) {
aout=&pf->voice[mp_channel];
i=aout->i;
s=aout->s;
Expand Down Expand Up @@ -2630,7 +2630,7 @@ void Player_NextPosition(void)
pf->patbrk=0;
pf->vbtick=pf->sngspd;

for (t=0;t<md_sngchn;t++) {
for (t=0;t<pf->numchn;t++) {
Voice_Stop_internal(t);
pf->voice[t].i=NULL;
pf->voice[t].s=NULL;
Expand All @@ -2655,7 +2655,7 @@ void Player_PrevPosition(void)
pf->patbrk=0;
pf->vbtick=pf->sngspd;

for (t=0;t<md_sngchn;t++) {
for (t=0;t<pf->numchn;t++) {
Voice_Stop_internal(t);
pf->voice[t].i=NULL;
pf->voice[t].s=NULL;
Expand All @@ -2682,7 +2682,7 @@ void Player_SetPosition(UWORD pos)
pf->sngpos=pos;
pf->vbtick=pf->sngspd;

for (t=0;t<md_sngchn;t++) {
for (t=0;t<pf->numchn;t++) {
Voice_Stop_internal(t);
pf->voice[t].i=NULL;
pf->voice[t].s=NULL;
Expand Down

0 comments on commit 8835542

Please sign in to comment.