Skip to content

fix(rendering): Prevent crash on null texture surface creation in Build_Textures - #588

Open
sentry[bot] wants to merge 1 commit into
mainfrom
seer/fix/render2d-build-textures-crash
Open

fix(rendering): Prevent crash on null texture surface creation in Build_Textures#588
sentry[bot] wants to merge 1 commit into
mainfrom
seer/fix/render2d-build-textures-crash

Conversation

@sentry

@sentry sentry Bot commented Sep 3, 2026

Copy link
Copy Markdown

This PR addresses a crash in Render2DSentenceClass::Build_Textures (CLIENT-1C6) that occurred when TextureClass::Get_Surface_Level() returned an invalid SurfaceClass (i.e., one whose underlying D3D surface was null). The issue manifested as an EXCEPTION_ACCESS_VIOLATION_READ / 0xc when attempting to dereference the invalid surface.

The fix introduces two null/validity checks within the Build_Textures loop:

  1. A check for new_texture == nullptr after W3DNEW TextureClass(...) to handle allocation failures.
  2. A check for texture_surface == nullptr || !texture_surface->Is_Valid() after new_texture->Get_Surface_Level() to ensure the D3D surface was successfully created.

If either check fails, the relevant objects are released, and the loop continues to the next pending surface, preventing the crash and aligning with existing defensive programming patterns in the codebase.

Fixes CLIENT-1C6

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

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