Skip to content

fix(gta-core-five): crmtComposer stack underflow in BlendN child counting#3825

Merged
prikolium-cfx merged 1 commit intocitizenfx:masterfrom
DaniGP17:fix/crmt-composer-stack-underflow
Mar 11, 2026
Merged

fix(gta-core-five): crmtComposer stack underflow in BlendN child counting#3825
prikolium-cfx merged 1 commit intocitizenfx:masterfrom
DaniGP17:fix/crmt-composer-stack-underflow

Conversation

@DaniGP17
Copy link
Contributor

Goal of this PR

Fix a stack underflow crash in crmtComposer that occurs when handling kNodeBlendN/kNodeMergeN/kNodeAddN nodes with specific child configurations.

The crash was caused by incorrect boolean logic when counting active children, which could result in more PushPair() calls than actual frames present on the composer stack. This led to an underflow access (m_FrameStack[-1]).

How is this PR achieving the goal

This PR corrects the boolean condition used when counting active children in the BlendN code path.
The original logic used:

if (!child->IsDisabled() || !child->IsSilent())

This incorrectly counted silent children, even though silent nodes do not push frames onto the stack during traversal.

The fix changes the logic to:

if (!child->IsDisabled() && !child->IsSilent())

This ensures that only children that actually contribute frames are counted, keeping the internal composer stack balanced and preventing underflow in PushPair().

This PR applies to the following area(s)

FiveM

Successfully tested on

Game builds: None
Platforms: Windows

Checklist

  • Code compiles and has been tested successfully.
  • Code explains itself well and/or is documented.
  • My commit message explains what the changes do and what they are for.
  • No extra compilation warnings are added by these changes.

Fixes issues

fixes #3669

@github-actions github-actions bot added the invalid Requires changes before it's considered valid and can be (re)triaged label Feb 16, 2026
@imLocutor
Copy link

@DaniGP17 i have a crash that u need to see, can u contact me on discord? locutor404

@prikolium-cfx prikolium-cfx merged commit 50db9b4 into citizenfx:master Mar 11, 2026
2 of 6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

invalid Requires changes before it's considered valid and can be (re)triaged

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Car–Motorcycle Collision at High FPS causing crash

4 participants