citizenfx / fivem

The source code for the Cfx.re modification frameworks, such as FiveM, RedM and LibertyM, as well as FXServer.
https://cfx.re/
3.57k stars 2.11k forks source link

Random crash related to scaleforms #2281

Closed manups4e closed 11 months ago

manups4e commented 11 months ago

image CfxCrashDump_2023_11_22_21_57_08.zip

Sadly i can't give a good repro as this error occurs randomly... could it be related to streamed custom GFX files? even tho i wasn't drawing any scaleform at the time of the crash.

If i'll find more info about the error i'll edit the issue

gottfriedleibniz commented 11 months ago

There looks to be a few issues related to GFxObjectInterface::CreateEmptyMovieClip.

  1. The hook looks to be missing a depth parameter (which gets sanitized and will skip GFxValue initialization).
  2. CreateEmptyMovieClip returning false is not handled.

The crashes being random would support the above being the issue (random stack values being read). Although, that is not guaranteed: GFxSprite::AddDisplayObject (0x14173767C/2944) returning null would lead to a similar crash. However, I wouldn't expect that to be "random" unless something like HandleSprite (#2157) is involved somewhere else.

manups4e commented 11 months ago

I do create empty movie clips same way as R* does.. the flash way so I think it's nothing I can handle on my side

nihonium-cfx commented 11 months ago

Should be fixed by https://github.com/citizenfx/fivem/commit/5031bb7ba9b13823166ad88ee7b4b3a4b329e594