mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-11-04 13:30:08 -05:00
Fixed an access to uninitialized variable in pcm_rate.c
Fixed an access to uninitialized variable in pcm_rate.c (in error message).
This commit is contained in:
parent
2b5006b03c
commit
7f9dd4ac65
1 changed files with 5 additions and 2 deletions
|
|
@ -1322,7 +1322,7 @@ int snd_pcm_rate_open(snd_pcm_t **pcmp, const char *name,
|
||||||
{
|
{
|
||||||
snd_pcm_t *pcm;
|
snd_pcm_t *pcm;
|
||||||
snd_pcm_rate_t *rate;
|
snd_pcm_rate_t *rate;
|
||||||
const char *type;
|
const char *type = NULL;
|
||||||
int err;
|
int err;
|
||||||
#ifndef PIC
|
#ifndef PIC
|
||||||
snd_pcm_rate_open_func_t open_func;
|
snd_pcm_rate_open_func_t open_func;
|
||||||
|
|
@ -1355,8 +1355,10 @@ int snd_pcm_rate_open(snd_pcm_t **pcmp, const char *name,
|
||||||
const char **types;
|
const char **types;
|
||||||
for (types = default_rate_plugins; *types; types++) {
|
for (types = default_rate_plugins; *types; types++) {
|
||||||
err = rate_open_func(rate, *types);
|
err = rate_open_func(rate, *types);
|
||||||
if (!err)
|
if (!err) {
|
||||||
|
type = *types;
|
||||||
break;
|
break;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
} else if (!snd_config_get_string(converter, &type))
|
} else if (!snd_config_get_string(converter, &type))
|
||||||
err = rate_open_func(rate, type);
|
err = rate_open_func(rate, type);
|
||||||
|
|
@ -1381,6 +1383,7 @@ int snd_pcm_rate_open(snd_pcm_t **pcmp, const char *name,
|
||||||
return -ENOENT;
|
return -ENOENT;
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
|
type = "linear";
|
||||||
open_func = SND_PCM_RATE_PLUGIN_ENTRY(linear);
|
open_func = SND_PCM_RATE_PLUGIN_ENTRY(linear);
|
||||||
err = open_func(SND_PCM_RATE_PLUGIN_VERSION, &rate->obj, &rate->ops);
|
err = open_func(SND_PCM_RATE_PLUGIN_VERSION, &rate->obj, &rate->ops);
|
||||||
if (err < 0) {
|
if (err < 0) {
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue