Closed tytan652 closed 3 years ago
Hi @tytan652 Does this warning / error still occur with OBS 27 / obs-rtspserver 2.0.4?
I'm actually giving it a try.
Same error with 2.0.4 with OBS 27
/home/tytan652/Programming/AUR/obs-rtspserver/src/obs-studio-27.0.0/plugins/obs-rtspserver-2.0.4/rtsp-server/xop/AACSource.cpp: In member function 'virtual std::string xop::AACSource::GetAttribute()':
/home/tytan652/Programming/AUR/obs-rtspserver/src/obs-studio-27.0.0/plugins/obs-rtspserver-2.0.4/rtsp-server/xop/AACSource.cpp:75:25: error: format not a string literal and no format arguments [-Werror=format-security]
75 | snprintf(nullptr, 0, rtpmap_fmt) + strlen(fmtp_fmt);
| ~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
cc1plus: some warnings being treated as errors
make[2]: *** [plugins/obs-rtspserver-2.0.4/rtsp-server/CMakeFiles/rtsp-server.dir/build.make:314: plugins/obs-rtspserver-2.0.4/rtsp-server/CMakeFiles/rtsp-server.dir/xop/AACSource.cpp.o] Error 1
make[2]: Leaving directory '/home/tytan652/Programming/AUR/obs-rtspserver/src/obs-studio-27.0.0/build'
make[1]: *** [CMakeFiles/Makefile2:1192: plugins/obs-rtspserver-2.0.4/rtsp-server/CMakeFiles/rtsp-server.dir/all] Error 2
make[1]: Leaving directory '/home/tytan652/Programming/AUR/obs-rtspserver/src/obs-studio-27.0.0/build'
make: *** [Makefile:156: all] Error 2
make: Leaving directory '/home/tytan652/Programming/AUR/obs-rtspserver/src/obs-studio-27.0.0/build'
When I look at this Changing:
snprintf(nullptr, 0, rtpmap_fmt) + strlen(fmtp_fmt);
To:
snprintf(nullptr, 0, "%s", rtpmap_fmt) + strlen(fmtp_fmt);
Make the compilation work, I don't know if it's a good fix.
@tytan652 I just compiled it with "%d" Did you tried if the .so file loads?
Edit: I just tried loading the .so file and it loads!
It loads with %s
even the setting window show up but I got memory leaks 11 on my side.
Edit: 11 memory leaks with %d
Edit: even with obs-rtspserver-bin
I get the 11 memory leaks
https://github.com/iamscottxu/obs-rtspserver/blob/master/rtsp-server/xop/AACSource.cpp#L69
Since it's strings like %s
shall be used
@tytan652 you are right....
Edit: even with
obs-rtspserver-bin
I get the 11 memory leaks
hmm.... I think it is because the other plugins are installed for me there are 13 memory leaks.
obs-rtspserver-bin contains the binary (which was compiled by @iamscottxu) and is downloaded directly from github.
I think the 11 memory leaks is another issue. Those one are surely done by not freeing correctly some variable.
I'm trying to update my AUR recipe of obs-rtspserver but when I compile it, I get this:
Note that AUR packagers should not modify default flags. Edit: The same happen with 2.0.1 and 2.0.2. I tried to build it on another ArchLinux machine same happen
PS: There is two AUR recipes for obs-rtspserver:
obs-rtspserver
built from sourceobs-rtspserver-bin
made with precompiled binaries