Commit Graph
3415 Commits
Author SHA1 Message Date
Cameron Gutman df7db4018e Fix some EGL error handling paths 2026-10-24 19:39:58 -05:00
Cameron Gutman bfc6751f0f Fix fd leak in VAAPI KMSDRM codepath 2026-10-24 19:39:58 -05:00
Cameron Gutman 2b690d14ad Initialize VAAPIRenderer class members 2026-10-24 19:39:47 -05:00
Cameron Gutman 4158fa7823 Don't add EGL modifiers for VA images if they aren't set 2026-10-24 18:49:46 -05:00
Cameron Gutman 372887b8a2 Don't copy unpopulated EGLAttribs 2026-10-24 18:49:46 -05:00
Cameron Gutman 0c4f7aefb6 Handle unexpected appVersion/gfeVersion quads 2026-10-24 18:49:46 -05:00
Cameron Gutman 1826d4c232 Fix incorrect mmap() failure check 2026-10-24 18:49:46 -05:00
Cameron Gutman 40f83bd294 Avoid wedging VDPAU renderer if mixer creation fails 2026-10-24 18:49:46 -05:00
Chris 8f2e52e540 Refuse to open a pre-existing log file (#2068)
On macOS, release builds log to /tmp/Moonlight-<epoch>.log. /tmp is
shared by all users and the file name is predictable, so another local
user could plant symlinks at upcoming log names and have Moonlight
truncate and overwrite any file the victim can write to. The log was
also created world-readable.

Open the log with QIODevice::NewOnly (O_CREAT|O_EXCL) so an existing
file or symlink is never opened, and create it readable only by the
owner on Qt 6.3+. If the open fails we keep logging to stderr, as we
already did for any other open failure.
2026-10-24 18:19:58 -05:00
Chris c8474c515c Avoid signed overflow in bs_read_se() (#2071)
bs_read_ue() can return values above INT32_MAX. bs_read_se() stored the
result in an int32_t and computed (r+1)/2, which is undefined behavior
when the code is 0x7FFFFFFF and gives wrong values for codes above
INT32_MAX. The SPS being parsed comes from the host during the H.264
SPS fixup.

Do the conversion in unsigned arithmetic. bs_read_ue() returns at most
0xFFFFFFFE, so both branches produce in-range int32_t values, and every
code that was previously well-defined decodes to the same value.
2026-10-24 18:17:00 -05:00
Cameron Gutman 781b26fd1c Completely disable connection caching on Qt 6.12+ 2026-10-22 23:01:46 -05:00
Cameron Gutman 74173b26eb Enforce a TCP/TLS HTTP timeout on Qt 6.3+
Timeouts for long requests like launch or resume timed the entire
HTTP operation. If the host was no longer reachable, we could
spend 2 minutes sitting there, even though we hadn't even made
successful contact with the host to give it our request yet.

Now we will time out a request if we can't send it in 5 seconds,
regardless of how long we want to wait for the server to respond.
2026-10-22 22:54:32 -05:00
Cameron Gutman b709bf5402 Handle musl headers without __NR_riscv_hwprobe defined 2026-10-22 22:14:04 -05:00
Cameron Gutman d79536b56d Only accept usable bounds if they differ from the full bounds
Some platforms (Wayland) just report the full display area, so we
incorrectly assume the entire display is usable for a window.

Fixes #2056
2026-10-22 20:53:30 -05:00
Cameron Gutman 74020b537b Don't start polling from the GUI for a CLI launch
We can end up missing early computerStateChanged signals.

Fixes #2039
2026-10-22 19:28:12 -05:00
Cameron Gutman dc92b6d2f3 Update moonlight-common-c 2026-10-20 00:35:04 -05:00
Cameron Gutman 9af0e9f539 Improve robustness and error handling of DXVsyncSource 2026-10-20 00:29:25 -05:00
Cameron Gutman e4db5c2c18 Check for pacing queue emptiness before dequeuing
This shouldn't actually be reachable when the queue
is empty, but we can check anyway to be safe.

Ref: #2054
2026-10-19 00:25:00 -05:00
Cameron Gutman 9b8886a6f5 Fix integer truncation warning on MSVC 2026-10-19 00:15:26 -05:00
Cameron Gutman f018a71a8a Override NSApplicationUpdateCycleEnabled to fix reduced mouse polling rate
Apps built with the macOS 26+ SDK default to an event loop synchronized to the display which caps input polling rates.

We have to use the plist for the opt-out, since NSApp is already set up by Qt before SDL can set this default.

Fixes #2036
2026-10-17 14:06:10 -05:00
Cameron Gutman b0af84ead1 Deploy the OpenSSL TLS backend for Qt
It supports TLS 1.3 and PQ-KEX back to Windows 10, unlike Schannel
2026-10-14 02:01:01 -05:00
Cameron Gutman 289782c6f3 Fix possible UB shift in bs_write_u() for large values of n 2026-10-14 01:51:15 -05:00
Cameron Gutman ee557e83c6 Include the trailing 16 bytes in the challengeResponseData check 2026-10-14 01:49:44 -05:00
Cameron Gutman 2bd4b9f721 Add missing checks for X509 parsing failures 2026-10-14 01:39:00 -05:00
Cameron Gutman fa6ae80940 Clamp additional values that can be used as array indices
These aren't exploitable in moonlight due to clamping done on the read side.
2026-10-14 01:09:54 -05:00
Cameron Gutman 71c3191e0c Remove warn_off for h264bitstream 2026-10-12 02:31:48 -05:00
Cameron Gutman a614924502 Don't hardcode the QSslKey algorithm 2026-10-12 02:31:21 -05:00
Cameron Gutman a57e947d71 Re-add the h264bitstream file headers mistakenly removed during vendoring 2026-10-07 20:19:06 -05:00
Cameron Gutman de2467e433 Fix MSI signing v6.2.0 2026-10-03 19:02:01 -05:00
Cameron Gutman b7e0deb168 Don't require SIGNTOOL_PARAMS to contain the 'sign' command 2026-10-03 18:37:39 -05:00
Cameron Gutman afcd08ccbc Require SIGNTOOL_PARAMS to be set externally 2026-10-03 18:30:08 -05:00
Cameron Gutman e8fefc8cd2 Prepare for v6.2.0 2026-10-03 16:32:35 -05:00
Cameron Gutman 018c851e76 Change the default streaming resolution to 1080p 2026-10-03 13:37:58 -05:00
Cameron Gutman 7927da33d6 Fix matching with colon-separated XDG_CURRENT_DESKTOP values 2026-10-03 13:11:12 -05:00
Cameron Gutman 32c6ab6eee Update Windows CI to Qt 6.12
macOS remains on Qt 6.11.2 for v6.x to retain Ventura support
2026-10-03 12:45:15 -05:00
Cameron Gutman 6e699e4dc9 Update libplacebo, sdl2-compat, and SDL3 2026-10-03 00:39:45 -05:00
Brad Smith a2486eaf94 Check elf_aux_info() return value in hasFastAes()
Check the result of elf_aux_info() on FreeBSD and OpenBSD ARM and fall
back to no AES support if the call fails, rather than relying on the
output variable being left untouched.
2026-10-02 23:10:50 -05:00
Cameron Gutman 8369d1a0e1 Reduce gamepad CPU usage on Steam Link
- Gamepad sensors are now disabled by default
- Added a small deadzone to limit excess gamepad input reports
2026-09-27 17:39:10 -05:00
Cameron Gutman c0f62ad64e Distinguish between Enter and Numpad Enter
Fixes #2015
2026-09-26 15:21:11 -05:00
Cameron Gutman b75fe0d932 Reorganize a couple mouse and keyboard functions 2026-09-26 15:01:07 -05:00
Cameron Gutman 8ec572517b Fix CFG violation on startup in OpenSSL 2026-09-26 14:32:24 -05:00
Cameron Gutman b78956dba7 Update SDL to 383fb13 and disable CFG for OpenSSL
Closes #2020
2026-09-26 12:56:37 -05:00
Cameron Gutman 032529d782 Update FFmpeg to 9.0.2 and libplacebo to e2972fd 2026-09-20 15:23:43 -05:00
Cameron Gutman 49bf1e80da Update libplacebo to 3330a515 2026-09-17 23:14:00 -05:00
Cameron Gutman ec71a4f562 Update SDL3 in AppImage to fix several X11 issues 2026-09-15 01:44:47 -05:00
Cameron Gutman e3fd29e4d7 Fix a livelock that can occur between SDL, libdecor-gtk, and Qt
The Qt UI continuously redrawing prevents libdecor-gtk's glib dispatch loop
from ever returning since it constantly posts new messages to draw again.

The result is that Moonlight randomly hangs (with the spinner still animating)
at the "Starting app..." phase of connection establishment and never proceeds
until the livelock is broken by loss of focus, hiding the window, or similar.

For posterity, the hanging stack:

QtWaylandClient::QWaylandWindow::waitForFrameSync (this=this@entry=..., timeout=timeout@entry=...) at qwaylandwindow.cpp:891
QtWaylandClient::QWaylandGLContext::swapBuffers (this=..., surface=...) at qwaylandglcontext.cpp:494
QRhiGles2::endFrame (this=..., swapChain=..., flags=...) at qrhigles2.cpp:2390
QRhi::endFrame (this=..., swapChain=..., flags=...) at qrhi.cpp:11600
QSGGuiThreadRenderLoop::renderWindow (this=..., window=...) at qsgrenderloop.cpp:714
QQuickWindow::event (this=..., event=...) at qquickwindow.cpp:1663
QCoreApplication::notifyInternal2 (receiver=..., event=...) at qcoreapplication.cpp:1126
QCoreApplication::sendEvent (receiver=..., event=...) at qcoreapplication.cpp:1571
QPlatformWindow::deliverUpdateRequest (this=...) at qplatformwindow.cpp:831
QObject::event (this=..., e=...) at qobject.cpp:1480
QCoreApplication::notifyInternal2 (receiver=..., event=...) at qcoreapplication.cpp:1126
QCoreApplication::sendEvent (receiver=..., event=...) at qcoreapplication.cpp:1571
QCoreApplicationPrivate::sendPostedEvents (receiver=..., event_type=..., data=...) at qcoreapplication.cpp:1926
postEventSourceDispatch (s=...) at qeventdispatcher_glib.cpp:248
g_main_dispatch (context=...) at gmain.c:3591
g_main_context_dispatch_unlocked (context=...) at gmain.c:4451
g_main_context_iterate_unlocked (context=context@entry=..., block=block@entry=..., dispatch=dispatch@entry=..., self=...) at gmain.c:4516
g_main_context_iteration (context=..., context@entry=..., may_block=may_block@entry=...) at gmain.c:4582
libdecor_plugin_gtk_dispatch (plugin=..., timeout=...) at libdecor-gtk.c:509
Wayland_PumpEvents (_this=...) at SDL_waylandevents.c:610
Wayland_GLES_LoadLibrary (_this=..., path=...) at SDL_waylandopengles.c:51
SDL_GL_LoadLibrary_REAL (path=...) at SDL_video.c:4735
SDL_RecreateWindow (window=..., flags=...) at SDL_video.c:2796
GLES2_CreateRenderer (renderer=..., window=..., create_props=...) at SDL_render_gles2.c:2329
SDL_CreateRendererWithProperties_REAL (props=props@entry=...) at SDL_render.c:1126
SDL_CreateRenderer_REAL (window=..., name=...) at SDL_render.c:1287
SDL_CreateRenderer_REAL (window=..., idx=..., flags=...) at sdl2_compat.c:5986
EGLRenderer::initialize (this=..., params=...) at eglvid.cpp:445
FFmpegVideoDecoder::initializeRendererInternal (this=..., renderer=..., params=...) at ffmpeg.cpp:323
FFmpegVideoDecoder::createFrontendRenderer (this=..., params=..., useAlternateFrontend=...) at ffmpeg.cpp:426
FFmpegVideoDecoder::completeInitialization (this=..., decoder=..., requiredFormat=..., params=..., testMode=..., useAlternateFrontend=...) at ffmpeg.cpp:486
FFmpegVideoDecoder::tryInitializeRenderer(AVCodec const*, AVPixelFormat, _DECODER_PARAMETERS*, AVCodecHWConfig const*, IFFmpegRenderer::InitFailureReason*, std::function<IFFmpegRenderer* ()>)
    (this=..., decoder=..., requiredFormat=..., params=..., hwConfig=..., failureReason=..., createRendererFunc=...) at ffmpeg.cpp:1200
FFmpegVideoDecoder::tryInitializeHwAccelDecoder (this=..., params=..., pass=..., terminallyFailedHardwareDecoders=...) at ffmpeg.cpp:1544
FFmpegVideoDecoder::initialize (this=..., params=...) at ffmpeg.cpp:1701
Session::chooseDecoder (vds=..., renderer=..., window=..., videoFormat=..., width=..., height=..., frameRate=..., enableVsync=..., enableFramePacing=..., testOnly=..., chosenDecoder=...) at session.cpp:322
Session::getDecoderAvailability (window=..., vds=..., videoFormat=..., width=..., height=..., frameRate=...) at session.cpp:498
Session::initialize (this=..., qtWindow=...) at session.cpp:755
2026-09-10 21:00:57 -05:00
Cameron Gutman 14c26d8c7d Update moonlight-common-c with frame loss fixes 2026-09-08 23:49:33 -05:00
Cameron Gutman f743c23663 Fix PixelShaderMinPrecision bitfield comparison 2026-09-07 00:07:10 -05:00
Cameron Gutman e9d77967a6 Replace Nvidia FL 11.1 check with driver version check
The bug is driver-specific rather than GPU-specific.
2026-09-06 22:53:24 -05:00
Cameron Gutman 31ce68f136 Log the GPU driver version in the D3D11VA renderer 2026-09-06 22:22:07 -05:00