-
Notifications
You must be signed in to change notification settings - Fork 914
Description
When SRTO_STREAMID is set to group socket SRT lib fails on "SRT_ASSERT(opt_size == default_opt_size);" assertion on group.cpp:456 due to incorrect option size interpretation in importOption function (default_opt_size == sizeof(std::string) == 32 and opt_size returned from getOptDefault call on group.cpp:454 is std::string().size() == 0) so process crashes with the following error:
srt/srtcore/group.cpp:456: void srt::importOption(std::vectorsrt::CUDTGroup::ConfigItem&, SRT_SOCKOPT, const ValueType&) [with ValueType = std::__cxx11::basic_string; SRT_SOCKOPT = SRT_SOCKOPT]: Assertion `opt_size == default_opt_size' failed.
To Reproduce
Steps to reproduce the behavior:
- build SRT with --enable-debug=1
- create a group socket and set SRTO_STREAMID:
auto sock = srt_create_group(SRT_GTYPE_BROADCAST);
std::string stream_id = "live/stream";
srt_setsockopt(sock, 0, SRTO_STREAMID, stream_id.c_str(), stream_id.length());
- See error
assertion failure later trying using this socket later (srt_connect_group and srt_sendmsg)
tested on Ubuntu 22.04 / SRT 1.5.4