Skip to content

fix: null-guard Add_Engine_Ref for vertex/index buffers - #564

Open
seer-by-sentry[bot] wants to merge 1 commit into
mainfrom
seer/fix/client-510-null-guard-add-engine-ref
Open

fix: null-guard Add_Engine_Ref for vertex/index buffers#564
seer-by-sentry[bot] wants to merge 1 commit into
mainfrom
seer/fix/client-510-null-guard-add-engine-ref

Conversation

@seer-by-sentry

Copy link
Copy Markdown

This PR addresses CLIENT-510 by adding null checks before calling Add_Engine_Ref() for render_state.vertex_buffers[0] in DX8Wrapper::Set_Vertex_Buffer and render_state.index_buffer in DX8Wrapper::Set_Index_Buffer.

Previously, Add_Engine_Ref() was called unconditionally, leading to an EXCEPTION_ACCESS_VIOLATION_WRITE when the vertex or index buffer pointer was NULL (e.g., for zero-vertex meshes or failed dynamic allocations). The corresponding Release_Engine_Ref() calls in these functions were already null-guarded, making this an inconsistent omission.

The fix ensures that Add_Engine_Ref() is only called if the buffer pointer is valid, preventing the access violation.

Fixes CLIENT-510

This PR was automatically generated by Sentry. You can adjust this setting at any time.

@github-actions

Copy link
Copy Markdown

⚠️ Title/Commit Validation Failed

Invalid PR title:

  • fix: null-guard Add_Engine_Ref for vertex/index buffers

Invalid commit messages:

  • fix: null-guard Add_Engine_Ref for vertex/index buffers
    PR titles and commit messages must follow conventional commits format:
type: Description
type(scope): Description

Allowed types: bugfix, build, chore, ci, docs, fix, feat, perf, refactor, revert, style, test, tweak, unify

See CONTRIBUTING.md for details.

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.

0 participants