Commit Graph

18674 Commits

Author SHA1 Message Date
Isaac Connor e373e871da Fix memleak caused by loadMonitor that is already loaded 2021-04-12 15:59:31 -04:00
Isaac Connor 7e579fd851 Implement Snapshots user permission 2021-04-12 15:59:31 -04:00
Isaac Connor a07374e206 Fix password getting unset in global user object. Add Snapshots to user permissions 2021-04-12 15:59:31 -04:00
Isaac Connor 7aa625ea8e Don't both loading all the Object code until after auth. 2021-04-12 15:59:31 -04:00
Isaac Connor cfe51d7349 Disconnect if we call loadMonitor a second time. 2021-04-12 15:59:31 -04:00
Isaac Connor 7adeb87041 fix logic that would leak mem by called loadMonitor repeatedly 2021-04-12 15:59:31 -04:00
Isaac Connor 1a81723ba5 add an isConnected function 2021-04-12 15:59:31 -04:00
Isaac Connor ab356a3695 Add a warning when connecting without disconnecting which can cause memleaks 2021-04-12 15:59:31 -04:00
Isaac Connor a3078d61f7 Default monitor filter bar to showing. Remove container-fluid which was adding padding at right and left. It should go elsewhere if needed. 2021-04-12 15:59:31 -04:00
Peter Keresztes Schmidt 0676f71cd6 Build/GCC: Suppress -Wclobbered warnings on older compilers
There were a high number of false positives with old compilers. Suppress these warnings on them.
2021-04-12 08:58:57 +02:00
Peter Keresztes Schmidt 4894c319cc Image: Fix Wtype-limits warnings in zm_convert_yuyv_rgb
The intermediate values can be negative. Change the variables to be signed so the clamping later on works correctly.
2021-04-12 08:58:57 +02:00
Peter Keresztes Schmidt 11cfa86de3 Image: Fix Wtype-limits warnings in Annotate
line[c] is a char. There is no possibility for it to be larger than 0xff. Remove these checks.
2021-04-12 08:58:56 +02:00
Peter Keresztes Schmidt b93d5556b2 Build: Re-enable Wtype-limits on GCC 2021-04-12 00:25:04 +02:00
Peter Keresztes Schmidt 7e1c580130 define: Add macro to annotate intended switch fallthroughs
Follow-up to 814953b331
It turns out [[gcc::fallthrough]] and -Wimplicit-fallthrough were only implemented in GCC 7 and throws a warning on older GCCs.
Add the FALLTHROUGH macro to handle GCC < 7 as found on Xenial.

Warning from GCC 5.5:
/home/runner/work/zoneminder/zoneminder/src/zm_remote_camera_http.cpp:624:13: warning: attributes at the beginning of statement are ignored [-Wattributes]
             [[gnu::fallthrough]];
2021-04-11 23:39:35 +02:00
Peter Keresztes Schmidt e8565b0704 Build: Enable implicit fallthrough warnings on clang 2021-04-11 23:39:35 +02:00
Peter Keresztes Schmidt 84067a6af8 CI/FreeBSD: Filter out noise from make 2021-04-11 23:39:35 +02:00
Isaac Connor af025db758 Release 1.34.24 2021-04-11 17:33:24 -04:00
Isaac Connor 53473b3db1
Merge pull request #3213 from Carbenium/ci-xenial
CI: Run basic CI for Xenial
2021-04-11 16:36:15 -04:00
Isaac Connor f077ec6145 Take first PTS into account when calculating last pts for figuring out which input to use. 2021-04-11 16:35:16 -04:00
Peter Keresztes Schmidt 56148207f6 CI: Run basic CI for Xenial
Tests can't be built since Catch2 is only packaged for Groovy (20.10)
2021-04-11 22:11:49 +02:00
Isaac Connor dab89622af Not having a video stream isn't actually bad. Change log to debug 2021-04-11 13:29:24 -04:00
Isaac Connor 594cebbcb1 Increase debugging level of input choice 2021-04-11 13:23:21 -04:00
Isaac Connor 939a0f40e6 Include image_count in debug line 2021-04-11 13:22:37 -04:00
Isaac Connor 7278119468 Update RtspServer with fix 2021-04-11 13:15:03 -04:00
Isaac Connor 053406bade Bump to version 1.35.25 2021-04-11 12:59:18 -04:00
Isaac Connor 4255f78602 Use monitor->Importance in passing severity of log message about failed to Prime Capture 2021-04-11 12:59:18 -04:00
Isaac Connor ed29021179 Rough in an importance setting in monitor that we can use to decrease the log level of certain events like PrimeCapture for cameras that we don't care about 2021-04-11 12:59:18 -04:00
Isaac Connor aadfa1e6e1 Remove warning on fail to Prime. zmc will log it 2021-04-11 12:59:18 -04:00
Isaac Connor d05f03eacd Merge branch 'master' of github.com:ZoneMinder/ZoneMinder 2021-04-11 12:45:07 -04:00
Isaac Connor 526b44b377 fix crash by using the correct FormatContext when dumping stream info 2021-04-11 12:44:59 -04:00
Peter Keresztes Schmidt 58a60b6974 dep/jwt-cpp: Update to latest commit
Update to 4620bf43befea5ef69816fb8610723232a609030.
This fixes a Wunused-private-field warning reported in https://github.com/Thalhammer/jwt-cpp/issues/134
2021-04-11 18:07:35 +02:00
Peter Keresztes Schmidt 627f972fac LocalCamera: Fix Wformat warnings reported by Clang 2021-04-11 18:00:12 +02:00
Isaac Connor f50bfab0aa
Merge pull request #3212 from Carbenium/sdp-deprec
SessionDescriptor: Fix a ffmpeg deprecation warning
2021-04-11 11:53:18 -04:00
Peter Keresztes Schmidt 9f643ddd00 MonitorStream: Actually use the MAX_SLEEP_USEC variable meant for this class 2021-04-11 14:39:08 +02:00
Peter Keresztes Schmidt 2d062c1f99 Fifo+EventStream: Remove unused private fields 2021-04-11 14:26:37 +02:00
Peter Keresztes Schmidt c255e78b97 SessionDescriptor: Fix a ffmpeg deprecation warning
AVStream::codec is deprecated. The replacement AVStream::codecpar is initialized at the end of the method from the codec context.
2021-04-11 11:41:53 +02:00
Peter Keresztes Schmidt 0203e744a5 RtspThread: Fix a stack-buffer-overflow reported by ASAN
==8109==ERROR: AddressSanitizer: stack-buffer-overflow on address 0x7fab9b156480 at pc 0x7fabaebef57b bp 0x7fab9b154640 sp 0x7fab9b153df0
READ of size 32 at 0x7fab9b156480 thread T2
    #0 0x7fabaebef57a  (/lib/x86_64-linux-gnu/libasan.so.5+0xb857a)
    #1 0x561c0a9e24eb in bool std::__equal<true>::equal<char>(char const*, char const*, char const*) /usr/include/c++/8/bits/stl_algobase.h:814
    #2 0x561c0a9dfa8e in bool std::__equal_aux<char*, char*>(char*, char*, char*) /usr/include/c++/8/bits/stl_algobase.h:831
    #3 0x561c0a9dd982 in bool std::equal<__gnu_cxx::__normal_iterator<char*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >
, __gnu_cxx::__normal_iterator<char*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > > >(__gnu_cxx::__normal_iterator<char*,
std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > >, __gnu_cxx::__normal_iterator<char*, std::__cxx11::basic_string<char, std::c
har_traits<char>, std::allocator<char> > >, __gnu_cxx::__normal_iterator<char*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char>
> >) /usr/include/c++/8/bits/stl_algobase.h:1049
    #4 0x561c0a9cf75a in RtspThread::Run() /root/zoneminder/src/zm_rtsp.cpp:411
    #5 0x561c0a9df6e9 in void std::__invoke_impl<void, void (RtspThread::*)(), RtspThread*>(std::__invoke_memfun_deref, void (RtspThread::*&&)(), RtspThread*&
&) /usr/include/c++/8/bits/invoke.h:73
    #6 0x561c0a9dd4ae in std::__invoke_result<void (RtspThread::*)(), RtspThread*>::type std::__invoke<void (RtspThread::*)(), RtspThread*>(void (RtspThread::
*&&)(), RtspThread*&&) (/root/zoneminder/cmake-build-debug-remote/src/zmc+0x1544ae)
    #7 0x561c0a9e6a1a in decltype (__invoke((_S_declval<0ul>)(), (_S_declval<1ul>)())) std:🧵:_Invoker<std::tuple<void (RtspThread::*)(), RtspThread*> >
::_M_invoke<0ul, 1ul>(std::_Index_tuple<0ul, 1ul>) /usr/include/c++/8/thread:244
    #8 0x561c0a9e698d in std:🧵:_Invoker<std::tuple<void (RtspThread::*)(), RtspThread*> >::operator()() /usr/include/c++/8/thread:253
    #9 0x561c0a9e68ff in std:🧵:_State_impl<std:🧵:_Invoker<std::tuple<void (RtspThread::*)(), RtspThread*> > >::_M_run() /usr/include/c++/8/threa
d:196
    #10 0x7fabaca57b2e  (/lib/x86_64-linux-gnu/libstdc++.so.6+0xbbb2e)
    #11 0x7fabae50dfa2 in start_thread /build/glibc-vjB4T1/glibc-2.28/nptl/pthread_create.c:486
    #12 0x7fabac7354ce in clone (/lib/x86_64-linux-gnu/libc.so.6+0xf94ce)
2021-04-11 11:37:03 +02:00
Isaac Connor 8799a33716
Merge pull request #3211 from Carbenium/zm-comms-cleanup
comms: Fix Woverloaded-virtual warnings
2021-04-10 21:24:27 -04:00
Peter Keresztes Schmidt 369fb68bb4 tests/comms: Disable tests which bind TCP sockets on CI runs
Those tests timeout on Cirrus. Disable them for now.
This introduces a new tag [notCI] with which tests can be marked which shouldn't be run during CI.
2021-04-11 02:46:56 +02:00
Peter Keresztes Schmidt 0ab6b04fa1 build: Enable Woverloaded-virtual on GCC 2021-04-11 01:28:23 +02:00
Peter Keresztes Schmidt 0c3244d011 comms/Socket: Mark methods which are not meant to be overridden as non-virtual
This fixes the remaining Woverloaded-virtual warnings.
2021-04-11 01:28:23 +02:00
Peter Keresztes Schmidt eacd9d4d36 comms: Add override specifier where necessary 2021-04-11 01:28:23 +02:00
Peter Keresztes Schmidt f84d23817e tests/comms: Add tests for TcpInetClient/Server 2021-04-11 01:28:23 +02:00
Peter Keresztes Schmidt 3d2614b429 comms: Quick-fix a crash in ZM::Socket::Accept
mLocalAddr is always nullptr and not used anywhere. So just use a local variable for
the time being.
The comms types will need an API rework since the current one is rather convoluted.
Postpone fixing this properly until then.
2021-04-11 01:28:23 +02:00
Peter Keresztes Schmidt 25e6b70381 tests/comms: Add tests for ZM::UdpUnixSocket 2021-04-11 01:28:23 +02:00
Peter Keresztes Schmidt 17485f3547 tests/comms: Add tests for ZM::UdpInetSocket 2021-04-11 01:28:23 +02:00
Peter Keresztes Schmidt 45986c8ee2 tests/comms: Add some tests for SockAddrInet/Unix 2021-04-11 01:28:23 +02:00
Peter Keresztes Schmidt 5aa508bc74 tests/comms: Add read/write tests for ZM::Pipe 2021-04-11 01:28:23 +02:00
Peter Keresztes Schmidt a06d374292 tests/comms: Add some basic tests for ZM::Pipe 2021-04-11 01:28:23 +02:00
Peter Keresztes Schmidt d7224261f7 comms: Implement ZM::Pipe::isClosed so we have a non-abstract class 2021-04-11 01:28:23 +02:00