Commit 76b25a13 authored by Max Kellermann's avatar Max Kellermann

output/alsa: add nullptr check for snd_pcm_name() return value

parent ccc3ee66
......@@ -5,6 +5,8 @@ ver 0.23.10 (not yet released)
- ffmpeg: fix libfmt 9 compiler warning
* encoder
- flac: fix failure when libFLAC is built without Ogg support
* output
- alsa: fix crash bug
* Windows
- log to stdout by default, don't require "log_file" setting
......
......@@ -812,8 +812,12 @@ AlsaOutput::Open(AudioFormat &audio_format)
fmt::format("Failed to open ALSA device \"{}\"",
GetDevice()).c_str());
const char *pcm_name = snd_pcm_name(pcm);
if (pcm_name == nullptr)
pcm_name = "?";
FmtDebug(alsa_output_domain, "opened {} type={}",
snd_pcm_name(pcm),
pcm_name,
snd_pcm_type_name(snd_pcm_type(pcm)));
#ifdef ENABLE_DSD
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment