From 5b2df0b35ca175f057ec6de1537b7a16d1a6e4e9 Mon Sep 17 00:00:00 2001 From: Wim Taymans Date: Thu, 6 Oct 2022 16:14:35 +0200 Subject: [PATCH] pulse-server: handle unknown format --- .../module-protocol-pulse/modules/module-rtp-send.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/modules/module-protocol-pulse/modules/module-rtp-send.c b/src/modules/module-protocol-pulse/modules/module-rtp-send.c index 61b3eae36..1f13e6507 100644 --- a/src/modules/module-protocol-pulse/modules/module-rtp-send.c +++ b/src/modules/module-protocol-pulse/modules/module-rtp-send.c @@ -178,8 +178,14 @@ static int module_rtp_send_prepare(struct module * const module) goto out; } info.format = 0; - if ((str = pw_properties_get(props, "format")) != NULL) - info.format = format_paname2id(str, strlen(str)); + if ((str = pw_properties_get(props, "format")) != NULL) { + if ((info.format = format_paname2id(str, strlen(str))) == + SPA_AUDIO_FORMAT_UNKNOWN) { + pw_log_error("unknown format %s", str); + res = -EINVAL; + goto out; + } + } if ((str = pw_properties_get(props, "destination_ip")) != NULL) pw_properties_set(global_props, "destination.ip", str);