fix(windows): prevent crashes from memory safety issues and buffer resize#46
Merged
Knightro63 merged 4 commits intoKnightro63:mainfrom Mar 9, 2026
Merged
Conversation
Open
…shes - Add input validation for texture dimensions (max 8192x8192) - Add integer overflow protection before memory allocation - Add null pointer validation before buffer operations - Fix exception handling to use references instead of values - Add OpenGL error checking before/after critical operations - Add comprehensive bounds checking in changeSize() method - Add memory allocation error handling with try-catch blocks Fixes crash with Exception Code 0xC0000409 (FAST_FAIL_FATAL_APP_EXIT) that was occurring in FlutterDesktopTextureRegistrarMarkExternalTextureFrameAvailable
- Add input validation for texture dimensions (max 8192x8192) - Add integer overflow protection before memory allocation - Add null pointer validation before buffer operations - Fix exception handling to use references instead of values - Add OpenGL error checking before/after critical operations - Add comprehensive bounds checking in changeSize() method - Add memory allocation error handling with try-catch blocks Fixes crash with Exception Code 0xC0000409 (FAST_FAIL_FATAL_APP_EXIT) that was occurring in FlutterDesktopTextureRegistrarMarkExternalTextureFrameAvailable
…o avoid partial reads and flicker - Update structure.width/height in buffer mode - Recreate framebuffer/renderbuffer when buffer size changes - Avoid duplicate FBO creation at init (setup handled after changeSize) Improves stability of PixelBufferTexture reads and texture updates
82d3a4a to
96a2e34
Compare
Knightro63
approved these changes
Mar 9, 2026
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.
Summary
This PR fixes critical Windows-specific crashes in the texture handling code: