When drop_start_samples and drop_end_samples overlap and are greater
than the actual number of samples, the `num_samples` calculation in
SubmitPCM() could underflow.
Closes https://github.com/MusicPlayerDaemon/MPD/issues/1712
The function spl_valid_name() should verify playlist names and prevent
path traversal, but it failed to do so on Windows, because it forgot
to check for backslashes.
This buggy piece of code was already present when stored playlists
were initially implemented in 2006 by commit 08003904d7, and
even during the many rounds of code refactoring, nobody ever bothered
to verify it. D'oh!
(Thanks, Paul Arzelier)
snprintf() does not return the (truncated) length actually written,
but the length that would be needed if the buffer were large enough.
This API usage mistake in FormatLastError() can lead to overflow of
the stack buffer, crashing the process (Windows only).
Closes https://github.com/MusicPlayerDaemon/MPD/issues/1676
If no archive library was found, return from the "plugins" directory
without creating "libarchive_plugins.a". Empty static libraries are
unsupported on some operating systems such as macOS.
Closes https://github.com/MusicPlayerDaemon/MPD/issues/1650
occurrences of the word Master/master with Main/main. This change was test built on two different systems.
1. macos 10.15.7 with Xcode 12.4 and clang 12.0.0 on x86_64
2. macos 12.5 with Xcode 13.4.1 and clang 13.1.6 on arm64 (Apple silicon M1)
It should be noted that on macos 10.15.7 with Xcode 11.2 and clang 11.0, MPD will not build.
The MPD documentation states that clang 11.0 is the minimum requirement,
but clang 11.0 produces compile errors. Apparently the macos version
of clang 11.0 is not fully compliant.
Properly deals with iconv, unlike the current solution. have_iconv fails
when libiconv CFLAGS are passed to the compiler. Tested under OpenWrt
with its CONFIG_BUILD_NLS, which adds libiconv include flags.
Signed-off-by: Rosen Penev <rosenp@gmail.com>
Deactivate the stream in Cancel(). This fixes stuttering after a
manual song change by refilling the whole ring buffer before
reactivating the stream.
Closes https://github.com/MusicPlayerDaemon/MPD/issues/1354
Clear not only MPD's ring buffer, but also libpipewire's buffers, to
avoid playing some audio from the previous song after a manual song
change.
Fixes part 1 of https://github.com/MusicPlayerDaemon/MPD/issues/1354
Removing the LockHasClients(); this code was copied from the "httpd"
output plugin, but unlike "httpd", the SnapCast output plugin does not
feed silence while paused, so we need to implement a delay to avoid
busy-looping the CPU.
As a side effect, this eliminates the suttering after resuming
playback, because the timer now gets reset even if there is a client.
Closes https://github.com/MusicPlayerDaemon/MPD/issues/1394
Since PipeWire 0.3.53, there is no control name anymore, therefore the
name check doesn't work anymore, breaking volume change events.
This obsoletes the crash bug fix in commit 2ee57f9b0d
If the PipeWire output has not yet been enabled and no thread_loop has
been created yet, a nullptr dereference in SetVolume() was possible
because nullptr was passed to pw_thread_loop_lock().
This fixes a std::terminate() crash in the CURL storage plugin when
PropfindOperation::OnHeaders() throws an exception after receiving a
non-207 status.
Closes https://github.com/MusicPlayerDaemon/MPD/issues/1559