mirror of
https://github.com/alsa-project/alsa-lib.git
synced 2025-10-29 05:40:25 -04:00
fixed dmix crashes by Clemens Ladisch <clemens@ladisch.de>:
pcm->name can be NULL (when an unnamed pcm node is embedded in another pcm)
This commit is contained in:
parent
7058054471
commit
18927bfe9a
4 changed files with 20 additions and 12 deletions
|
|
@ -414,9 +414,11 @@ static int snd_pcm_dmix_info(snd_pcm_t *pcm, snd_pcm_info_t * info)
|
||||||
info->stream = pcm->stream;
|
info->stream = pcm->stream;
|
||||||
info->card = -1;
|
info->card = -1;
|
||||||
/* FIXME: fill this with something more useful: we know the hardware name */
|
/* FIXME: fill this with something more useful: we know the hardware name */
|
||||||
strncpy(info->id, pcm->name, sizeof(info->id));
|
if (pcm->name) {
|
||||||
strncpy(info->name, pcm->name, sizeof(info->name));
|
strncpy(info->id, pcm->name, sizeof(info->id));
|
||||||
strncpy(info->subname, pcm->name, sizeof(info->subname));
|
strncpy(info->name, pcm->name, sizeof(info->name));
|
||||||
|
strncpy(info->subname, pcm->name, sizeof(info->subname));
|
||||||
|
}
|
||||||
info->subdevices_count = 1;
|
info->subdevices_count = 1;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -201,9 +201,11 @@ static int snd_pcm_dshare_info(snd_pcm_t *pcm, snd_pcm_info_t * info)
|
||||||
info->stream = pcm->stream;
|
info->stream = pcm->stream;
|
||||||
info->card = -1;
|
info->card = -1;
|
||||||
/* FIXME: fill this with something more useful: we know the hardware name */
|
/* FIXME: fill this with something more useful: we know the hardware name */
|
||||||
strncpy(info->id, pcm->name, sizeof(info->id));
|
if (pcm->name) {
|
||||||
strncpy(info->name, pcm->name, sizeof(info->name));
|
strncpy(info->id, pcm->name, sizeof(info->id));
|
||||||
strncpy(info->subname, pcm->name, sizeof(info->subname));
|
strncpy(info->name, pcm->name, sizeof(info->name));
|
||||||
|
strncpy(info->subname, pcm->name, sizeof(info->subname));
|
||||||
|
}
|
||||||
info->subdevices_count = 1;
|
info->subdevices_count = 1;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -184,9 +184,11 @@ static int snd_pcm_dsnoop_info(snd_pcm_t *pcm, snd_pcm_info_t * info)
|
||||||
info->stream = pcm->stream;
|
info->stream = pcm->stream;
|
||||||
info->card = -1;
|
info->card = -1;
|
||||||
/* FIXME: fill this with something more useful: we know the hardware name */
|
/* FIXME: fill this with something more useful: we know the hardware name */
|
||||||
strncpy(info->id, pcm->name, sizeof(info->id));
|
if (pcm->name) {
|
||||||
strncpy(info->name, pcm->name, sizeof(info->name));
|
strncpy(info->id, pcm->name, sizeof(info->id));
|
||||||
strncpy(info->subname, pcm->name, sizeof(info->subname));
|
strncpy(info->name, pcm->name, sizeof(info->name));
|
||||||
|
strncpy(info->subname, pcm->name, sizeof(info->subname));
|
||||||
|
}
|
||||||
info->subdevices_count = 1;
|
info->subdevices_count = 1;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -70,9 +70,11 @@ static int snd_pcm_null_info(snd_pcm_t *pcm, snd_pcm_info_t * info)
|
||||||
memset(info, 0, sizeof(*info));
|
memset(info, 0, sizeof(*info));
|
||||||
info->stream = pcm->stream;
|
info->stream = pcm->stream;
|
||||||
info->card = -1;
|
info->card = -1;
|
||||||
strncpy(info->id, pcm->name, sizeof(info->id));
|
if (pcm->name) {
|
||||||
strncpy(info->name, pcm->name, sizeof(info->name));
|
strncpy(info->id, pcm->name, sizeof(info->id));
|
||||||
strncpy(info->subname, pcm->name, sizeof(info->subname));
|
strncpy(info->name, pcm->name, sizeof(info->name));
|
||||||
|
strncpy(info->subname, pcm->name, sizeof(info->subname));
|
||||||
|
}
|
||||||
info->subdevices_count = 1;
|
info->subdevices_count = 1;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue