comparison src/madplug/decoder.c @ 2287:2421c87fb855

Fix memory leak in mad plugin when changing songs and writing output. (Bugzilla #82)
author Jussi Judin <jjudin+audacious@iki.fi>
date Wed, 09 Jan 2008 09:25:48 -0600
parents d25cd7e7eddb
children 47d7a45b26a0
comparison
equal deleted inserted replaced
2286:4f84615468b7 2287:2421c87fb855
151 output[pos++] = (sample >> 0) & 0xff; 151 output[pos++] = (sample >> 0) & 0xff;
152 output[pos++] = (sample >> 8) & 0xff; 152 output[pos++] = (sample >> 8) & 0xff;
153 } 153 }
154 } 154 }
155 assert(pos == olen); 155 assert(pos == olen);
156 if (!info->playback->playing) 156 if (!info->playback->playing) {
157 g_free(output);
157 return; 158 return;
159 }
158 info->playback->pass_audio(info->playback, 160 info->playback->pass_audio(info->playback,
159 FMT_S16_LE, MAD_NCHANNELS(header), olen, output, &(info->playback->playing)); 161 FMT_S16_LE, MAD_NCHANNELS(header), olen, output, &(info->playback->playing));
160 if (!info->playback->playing)
161 return;
162 g_free(output); 162 g_free(output);
163 } 163 }
164 164
165 /** 165 /**
166 * Decode all headers in the file and fill in stats 166 * Decode all headers in the file and fill in stats