Skip to content

Commit

Permalink
Merge prevent memory corruption in gta-streaming-five (mr-549)
Browse files Browse the repository at this point in the history
9e002fd - fix(game/five): increase fwArchetypePooledMap pool size
d4f5c48 - fix(game/five): prevent memory corruption in gta-streaming-five
  • Loading branch information
nihonium committed Oct 14, 2024
2 parents 72c2081 + 9e002fd commit 1b0b6ff
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -532,9 +532,12 @@ static void fwEntity_DtorWrap(rage::fwEntity* entity)
// to do this, we use a little hack to not have to manually read the archetype list:
// the base rage::fwEntity::SetModelId doesn't do anything other than setting (rcx + 32)
// to the resolved archetype, or nullptr if none
//
// Note: for build 3258+ - this function actually tries to do more than just setting the archetype,
// but if the input is initialized with zeroes - it will work as we want it to.
rage::fwModelId modelId(midx);

void* fakeEntity[40 / 8] = { 0 };
void* fakeEntity[64 / 8] = { 0 };
_fwEntity_SetModelId(fakeEntity, modelId);

// not the same archetype - bail out
Expand Down
2 changes: 1 addition & 1 deletion data/client/citizen/common/data/gameconfig.xml
Original file line number Diff line number Diff line change
Expand Up @@ -608,7 +608,7 @@
</Item>
<Item>
<PoolName>fwArchetypePooledMap</PoolName>
<PoolSize value="64000"/>
<PoolSize value="65000"/>
</Item>
<Item>
<PoolName>CTaskConversationHelper</PoolName>
Expand Down

0 comments on commit 1b0b6ff

Please sign in to comment.