Fix unsafe fixed buffer pointer handling in F1 telemetry extensions#11
Merged
codegefluester merged 5 commits intofeat/udp-base-sourcefrom Feb 11, 2026
Merged
Fix unsafe fixed buffer pointer handling in F1 telemetry extensions#11codegefluester merged 5 commits intofeat/udp-base-sourcefrom
codegefluester merged 5 commits intofeat/udp-base-sourcefrom
Conversation
Merged
- Fix F1TelemetryFrameExtensions to use Unsafe.Read<T> and direct pointer access for fixed buffers - Change F12025 Participant m_name from ByValTStr to byte array for proper UTF-8 marshaling - UdpSourceBase Dispose() implementation already correct (from previous PR) Co-authored-by: codegefluester <203914+codegefluester@users.noreply.github.com>
Co-authored-by: codegefluester <203914+codegefluester@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add source for F1 games
Fix unsafe fixed buffer pointer handling in F1 telemetry extensions
Feb 10, 2026
Use Unsafe.AsPointer(ref frame.RawData[0]) instead of Unsafe.Read to properly get a pointer to the fixed buffer. This resolves both the CS0213 compilation error and the runtime AccessViolationException. Co-authored-by: codegefluester <203914+codegefluester@users.noreply.github.com>
codegefluester
approved these changes
Feb 11, 2026
codegefluester
added a commit
that referenced
this pull request
Feb 11, 2026
* Added F1 2025 packets * Added F1 2024 types * Added F1 2023 structs * Added F1 packets and fixtures * Added F1 2025 packets * Added F1 2024 types * Added F1 2023 structs * Added F1 packets and fixtures * Remove legacy F1 implementation workflow file * Remove debug tooling for F1 * Add F1 fixture files to test project * Add refactoring plan for telemetry source interface * Remove debug logging * Added test cases for F1 packet parsing (super basic) * Added tests for event details parsing in F1 2025 * Tested F1 recording and reading of session recording * Update GamesDat.Demo.Wpf/Resources/Styles.xaml Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Björn Kaiser <masterchiefs2002@hotmail.com> * Update GamesDat.Demo.Wpf/ViewModels/IRealtimeSource.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Signed-off-by: Björn Kaiser <masterchiefs2002@hotmail.com> * [WIP] WIP Address feedback on adding source for F1 games (#5) * Initial plan * Fix: Change m_zoneFlag from byte to sbyte in F12025 MarshalZone Co-authored-by: codegefluester <203914+codegefluester@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: codegefluester <203914+codegefluester@users.noreply.github.com> * Apply BufferSize to UDP socket ReceiveBufferSize (#6) * Initial plan * Apply BufferSize to socket's ReceiveBufferSize property Co-authored-by: codegefluester <203914+codegefluester@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: codegefluester <203914+codegefluester@users.noreply.github.com> * Refactor UdpSourceBase to use proper Dispose pattern (#7) * Initial plan * Refactor UdpSourceBase to use Dispose pattern instead of manual disposal in finally block Co-authored-by: codegefluester <203914+codegefluester@users.noreply.github.com> * Add thread-safety to Dispose method in UdpSourceBase Co-authored-by: codegefluester <203914+codegefluester@users.noreply.github.com> * Move base.Dispose() inside lock for better thread-safety Co-authored-by: codegefluester <203914+codegefluester@users.noreply.github.com> * Set disposed flag before disposal operations for better exception safety Co-authored-by: codegefluester <203914+codegefluester@users.noreply.github.com> * Add try-finally to ensure base.Dispose() is always called Co-authored-by: codegefluester <203914+codegefluester@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: codegefluester <203914+codegefluester@users.noreply.github.com> * Make LiveryColour struct fields public for deserialization access (#8) * Initial plan * Make LiveryColour fields public to allow access Co-authored-by: codegefluester <203914+codegefluester@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: codegefluester <203914+codegefluester@users.noreply.github.com> * Remove unused BytesToStruct method from F1RealtimeTelemetrySource (#9) * Initial plan * Remove unused BytesToStruct method from F1RealtimeTelemetrySource Co-authored-by: codegefluester <203914+codegefluester@users.noreply.github.com> --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: codegefluester <203914+codegefluester@users.noreply.github.com> * [WIP] WIP address feedback from review on adding source for F1 games (#10) * Initial plan * Remove .claude/settings.local.json files from repository * Push changes - removed .claude/settings.local.json files Co-authored-by: codegefluester <203914+codegefluester@users.noreply.github.com> * Remove .claude/settings.local.json files and update .gitignore pattern --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: codegefluester <203914+codegefluester@users.noreply.github.com> * Fix unsafe fixed buffer pointer handling in F1 telemetry extensions (#11) * Initial plan * Fix unsafe fixed buffer pointer handling and UTF-8 marshaling - Fix F1TelemetryFrameExtensions to use Unsafe.Read<T> and direct pointer access for fixed buffers - Change F12025 Participant m_name from ByValTStr to byte array for proper UTF-8 marshaling - UdpSourceBase Dispose() implementation already correct (from previous PR) Co-authored-by: codegefluester <203914+codegefluester@users.noreply.github.com> * Add Name property helper for UTF-8 decoded participant name Co-authored-by: codegefluester <203914+codegefluester@users.noreply.github.com> * Fix AccessViolationException in GetPacket by using Unsafe.AsPointer Use Unsafe.AsPointer(ref frame.RawData[0]) instead of Unsafe.Read to properly get a pointer to the fixed buffer. This resolves both the CS0213 compilation error and the runtime AccessViolationException. Co-authored-by: codegefluester <203914+codegefluester@users.noreply.github.com> * Fix frame extension and test --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: codegefluester <203914+codegefluester@users.noreply.github.com> Co-authored-by: Björn Kaiser <bjoern@codegefluester.de> --------- Signed-off-by: Björn Kaiser <masterchiefs2002@hotmail.com> Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> Co-authored-by: Copilot <198982749+Copilot@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.