1
0
mirror of https://git.ffmpeg.org/ffmpeg.git synced 2026-10-24 02:09:03 +03:00

libavdevice/alsa.c: fix NULL pointer dereference

(cherry picked from commit 82d7e375f1)
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
This commit is contained in:
Romain Beauxis
2026-04-18 09:14:50 -05:00
committed by Michael Niedermayer
parent 6299a0a5e2
commit 15032633ec

View File

@@ -381,8 +381,10 @@ int ff_alsa_get_device_list(AVDeviceInfoList *device_list, snd_pcm_stream_t stre
ret = AVERROR(ENOMEM);
goto fail;
}
new_device->device_name = av_strdup(name);
if ((tmp = strrchr(descr, '\n')) && tmp[1])
new_device->device_name = av_strdup(name ? name : "");
if (!descr)
new_device->device_description = av_strdup("");
else if ((tmp = strrchr(descr, '\n')) && tmp[1])
new_device->device_description = av_strdup(&tmp[1]);
else
new_device->device_description = av_strdup(descr);