mirror of
https://github.com/alsa-project/alsa-utils
synced 2024-11-10 00:25:43 +01:00
Fix segfault in aplay when snd_pcm_name() == NULL
Fix segfault in aplay when snd_pcm_name() == NULL.
This commit is contained in:
parent
e45ba7e644
commit
2759c90a67
1 changed files with 2 additions and 1 deletions
|
@ -918,8 +918,9 @@ static void set_params(void)
|
|||
if ((float)rate * 1.05 < hwparams.rate || (float)rate * 0.95 > hwparams.rate) {
|
||||
if (!quiet_mode) {
|
||||
char plugex[64];
|
||||
const char *pcmname = snd_pcm_name(handle);
|
||||
fprintf(stderr, _("Warning: rate is not accurate (requested = %iHz, got = %iHz)\n"), rate, hwparams.rate);
|
||||
if (strchr(snd_pcm_name(handle), ':'))
|
||||
if (! pcmname || strchr(snd_pcm_name(handle), ':'))
|
||||
*plugex = 0;
|
||||
else
|
||||
snprintf(plugex, sizeof(plugex), "(-Dplug:%s)",
|
||||
|
|
Loading…
Reference in a new issue