mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-11-01 22:58:49 -04:00
always handle return value from snd_config_get_id() (coverity)
This commit is contained in:
parent
b0e4652881
commit
8a38461fac
2 changed files with 6 additions and 4 deletions
|
|
@ -1339,7 +1339,8 @@ static int is_string_array(const snd_config_t *conf)
|
||||||
if (i && i != snd_config_iterator_end(conf)) {
|
if (i && i != snd_config_iterator_end(conf)) {
|
||||||
snd_config_t *n = snd_config_iterator_entry(i);
|
snd_config_t *n = snd_config_iterator_entry(i);
|
||||||
const char *id;
|
const char *id;
|
||||||
snd_config_get_id(n, &id);
|
if (snd_config_get_id(n, &id) < 0)
|
||||||
|
return 0;
|
||||||
if (id && strcmp(id, "0") != 0)
|
if (id && strcmp(id, "0") != 0)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
@ -1422,7 +1423,8 @@ int snd_pcm_rate_open(snd_pcm_t **pcmp, const char *name,
|
||||||
snd_config_for_each(i, next, converter) {
|
snd_config_for_each(i, next, converter) {
|
||||||
snd_config_t *n = snd_config_iterator_entry(i);
|
snd_config_t *n = snd_config_iterator_entry(i);
|
||||||
const char *id;
|
const char *id;
|
||||||
snd_config_get_id(n, &id);
|
if (snd_config_get_id(n, &id) < 0)
|
||||||
|
continue;
|
||||||
if (strcmp(id, "name") != 0)
|
if (strcmp(id, "name") != 0)
|
||||||
continue;
|
continue;
|
||||||
snd_config_get_string(n, &type);
|
snd_config_get_string(n, &type);
|
||||||
|
|
|
||||||
|
|
@ -653,8 +653,8 @@ static int parse_tuple_sets(snd_config_t *cfg,
|
||||||
int err;
|
int err;
|
||||||
|
|
||||||
if (snd_config_get_type(cfg) != SND_CONFIG_TYPE_COMPOUND) {
|
if (snd_config_get_type(cfg) != SND_CONFIG_TYPE_COMPOUND) {
|
||||||
snd_config_get_id(cfg, &id);
|
if (snd_config_get_id(cfg, &id) >= 0)
|
||||||
SNDERR("error: compound type expected for %s", id);
|
SNDERR("error: compound type expected for %s", id);
|
||||||
return -EINVAL;
|
return -EINVAL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue