Fix segfault with downsampling

Fix segfault in the initialization for downsampling.
This commit is contained in:
Takashi Iwai 2005-03-31 15:24:40 +00:00
parent a0a440dcf4
commit 1889920a43

View file

@ -751,7 +751,8 @@ static int snd_pcm_rate_init(snd_pcm_t *pcm)
switch (rate->type) { switch (rate->type) {
case RATE_TYPE_LINEAR: case RATE_TYPE_LINEAR:
/* for expand */ /* for expand */
memset(rate->old_sample, 0, sizeof(*rate->old_sample) * pcm->channels); if (rate->old_sample)
memset(rate->old_sample, 0, sizeof(*rate->old_sample) * pcm->channels);
break; break;
default: default:
assert(0); assert(0);