mirror of
https://mirror.skon.top/https://github.com/FFmpeg/FFmpeg
synced 2026-04-20 21:00:41 +08:00
libavdevice/alsa.c: fix NULL pointer dereference
This commit is contained in:
@@ -383,8 +383,10 @@ int ff_alsa_get_device_list(AVDeviceInfoList *device_list, snd_pcm_stream_t stre
|
|||||||
ret = AVERROR(ENOMEM);
|
ret = AVERROR(ENOMEM);
|
||||||
goto fail;
|
goto fail;
|
||||||
}
|
}
|
||||||
new_device->device_name = av_strdup(name);
|
new_device->device_name = av_strdup(name ? name : "");
|
||||||
if ((tmp = strrchr(descr, '\n')) && tmp[1])
|
if (!descr)
|
||||||
|
new_device->device_description = av_strdup("");
|
||||||
|
else if ((tmp = strrchr(descr, '\n')) && tmp[1])
|
||||||
new_device->device_description = av_strdup(&tmp[1]);
|
new_device->device_description = av_strdup(&tmp[1]);
|
||||||
else
|
else
|
||||||
new_device->device_description = av_strdup(descr);
|
new_device->device_description = av_strdup(descr);
|
||||||
|
|||||||
@@ -2,5 +2,13 @@ FATE_LIBAVDEVICE-$(CONFIG_JACK_INDEV) += fate-timefilter
|
|||||||
fate-timefilter: libavdevice/tests/timefilter$(EXESUF)
|
fate-timefilter: libavdevice/tests/timefilter$(EXESUF)
|
||||||
fate-timefilter: CMD = run libavdevice/tests/timefilter
|
fate-timefilter: CMD = run libavdevice/tests/timefilter
|
||||||
|
|
||||||
|
tests/data/alsa_nodesc.conf: | tests/data
|
||||||
|
$(Q)printf 'pcm.nodesc {\n\ttype null\n\thint {\n\t\tshow on\n\t}\n}\n' > $@
|
||||||
|
|
||||||
|
FATE_FFMPEG-$(CONFIG_ALSA_INDEV) += fate-alsa-device-list-nodesc
|
||||||
|
fate-alsa-device-list-nodesc: tests/data/alsa_nodesc.conf
|
||||||
|
fate-alsa-device-list-nodesc: CMD = (export ALSA_CONFIG_PATH=$(TARGET_PATH)/tests/data/alsa_nodesc.conf && ffmpeg -sources alsa)
|
||||||
|
fate-alsa-device-list-nodesc: CMP = null
|
||||||
|
|
||||||
FATE-$(CONFIG_AVDEVICE) += $(FATE_LIBAVDEVICE-yes)
|
FATE-$(CONFIG_AVDEVICE) += $(FATE_LIBAVDEVICE-yes)
|
||||||
fate-libavdevice: $(FATE_LIBAVDEVICE-yes)
|
fate-libavdevice: $(FATE_LIBAVDEVICE-yes)
|
||||||
|
|||||||
Reference in New Issue
Block a user