Skip to content

Bump moonlight-common-c to 41cedb8 - #74

Merged
trexx merged 1 commit into
masterfrom
deps/moonlight-common-c-41cedb8
Oct 25, 2026
Merged

trexx merged 1 commit into
masterfrom
deps/moonlight-common-c-41cedb8

Conversation

@trexx

@trexx trexx commented Oct 25, 2026

Copy link
Copy Markdown
Owner

Fifteen upstream commits past the 62e0663 pin, and nanors b1e3c22 -> a9b1636. The
ones that matter here:

970b072 Fix use after free of queued controller packets
41cedb8 Only intercept ENet disconnects addressed to our peer
e2722dc Fix uninitialized stack data in the periodic ping payload
5ec8397 Fix memory leak if duplicate RTSP options are inserted
aeba988 Rework RTSP parser to fix many spec compliance issues
4a95eb3 Send UTF-8 events on the keyboard channel
0405384 Pack NV_UNICODE_PACKET densely for Sunshine
448b2c6 Latch mouse deltas before sending to prevent starvation
342b106 Perform control stream encryption in-place
f900dd4 Add MODIFIER_EXTENDED flag to indicate extended keys

970b072 is the reason to take it now. currentQueuedControllerPacket[] was neither
cleared across sessions nor on the queue-full branch, so a second stream in the
same process could write its first controller event into a freed holder - lost
stick input at best, heap corruption at worst.

4a95eb3 helps the IME directly: keystrokes and text events from TextKeyPlanner
now share a channel, so a mixed commit can no longer be reordered on the host.
The library still splits text into 32-byte packets for Sunshine, so the 512-byte
chunking and 15 ms spacing in TextKeyPlanner stay correct as written.

MODIFIER_EXTENDED is not used. Its one gain is Numpad Enter vs Enter, and the
Sunshine-family host checked does not read the flag; it derives the extended bit
from the VK for every navigation key already.

The C API only grows, so nothing in the Java or JNI layer changes. Patches 0002,
0004 and 0005 apply unchanged.

Latency: none on the video path - no change to the receive, FEC queue or
depacketizer. nanors' changes are bounds checks in setup/allocation and x86-only
CPU detection; reed_solomon_decode()'s NEON path is untouched. Input packets get
marginally cheaper (in-place encryption drops a 256-byte copy per packet).

Verified: assembleRelease builds both ABIs from clean native intermediates with
the three patches applied; testDebugUnitTest passes 314 tests. Not verified on
hardware - HARDWARE_TESTING.md section 32 lists what to check on each box.

🤖 Generated with Claude Code

https://claude.ai/code/session_01ShRgaYwZx3XGmFkZvjJaeY

Fifteen upstream commits past the 62e0663 pin, and nanors b1e3c22 -> a9b1636. The
ones that matter here:

  970b072  Fix use after free of queued controller packets
  41cedb8  Only intercept ENet disconnects addressed to our peer
  e2722dc  Fix uninitialized stack data in the periodic ping payload
  5ec8397  Fix memory leak if duplicate RTSP options are inserted
  aeba988  Rework RTSP parser to fix many spec compliance issues
  4a95eb3  Send UTF-8 events on the keyboard channel
  0405384  Pack NV_UNICODE_PACKET densely for Sunshine
  448b2c6  Latch mouse deltas before sending to prevent starvation
  342b106  Perform control stream encryption in-place
  f900dd4  Add MODIFIER_EXTENDED flag to indicate extended keys

970b072 is the reason to take it now. currentQueuedControllerPacket[] was neither
cleared across sessions nor on the queue-full branch, so a second stream in the
same process could write its first controller event into a freed holder - lost
stick input at best, heap corruption at worst.

4a95eb3 helps the IME directly: keystrokes and text events from TextKeyPlanner
now share a channel, so a mixed commit can no longer be reordered on the host.
The library still splits text into 32-byte packets for Sunshine, so the 512-byte
chunking and 15 ms spacing in TextKeyPlanner stay correct as written.

MODIFIER_EXTENDED is not used. Its one gain is Numpad Enter vs Enter, and the
Sunshine-family host checked does not read the flag; it derives the extended bit
from the VK for every navigation key already.

The C API only grows, so nothing in the Java or JNI layer changes. Patches 0002,
0004 and 0005 apply unchanged.

Latency: none on the video path - no change to the receive, FEC queue or
depacketizer. nanors' changes are bounds checks in setup/allocation and x86-only
CPU detection; reed_solomon_decode()'s NEON path is untouched. Input packets get
marginally cheaper (in-place encryption drops a 256-byte copy per packet).

Verified: assembleRelease builds both ABIs from clean native intermediates with
the three patches applied; testDebugUnitTest passes 314 tests. Not verified on
hardware - HARDWARE_TESTING.md section 32 lists what to check on each box.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01ShRgaYwZx3XGmFkZvjJaeY
@trexx
trexx merged commit 74cbc93 into master Oct 25, 2026
2 checks passed
@trexx
trexx deleted the deps/moonlight-common-c-41cedb8 branch October 28, 2026 18:43
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant