mirror of
https://gitlab.freedesktop.org/pipewire/pipewire.git
synced 2025-11-10 13:30:05 -05:00
pw-reserve: require valid name + check rd_reserve_new errors
Empty name in rd_device_new triggers assert inside DBus, so bail out before that.
This commit is contained in:
parent
422c270a74
commit
b12119da28
3 changed files with 44 additions and 2 deletions
|
|
@ -142,8 +142,8 @@ int main(int argc, char *argv[])
|
|||
return -1;
|
||||
}
|
||||
}
|
||||
if (opt_name == NULL) {
|
||||
fprintf(stderr, "name must be given\n");
|
||||
if (opt_name == NULL || !rd_device_valid_device_name(opt_name)) {
|
||||
fprintf(stderr, "valid name must be given\n");
|
||||
return -1;
|
||||
}
|
||||
|
||||
|
|
@ -190,6 +190,11 @@ int main(int argc, char *argv[])
|
|||
opt_appname,
|
||||
opt_priority,
|
||||
&reserve_callbacks, &impl);
|
||||
if (!impl.device) {
|
||||
res = -errno;
|
||||
fprintf(stderr, "dbus connection failed: %m\n");
|
||||
goto exit;
|
||||
}
|
||||
|
||||
if (!opt_monitor) {
|
||||
res = rd_device_acquire(impl.device);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue