Skip to content

Fix crash when loading/unloading truncated IFP files - #5559

Closed
MohabCodeX wants to merge 2 commits into
multitheftauto:masterfrom
MohabCodeX:fix/ifp-cleanup-null-deref
Closed

MohabCodeX wants to merge 2 commits into
multitheftauto:masterfrom
MohabCodeX:fix/ifp-cleanup-null-deref

Conversation

@MohabCodeX

Copy link
Copy Markdown
Contributor

Fixes a client crash that occurs when loading malformed or truncated custom IFP files and during cleanup on disconnect.

  • Stop reading animation entries once the end of the file is reached instead of reading past the buffer.
  • Log a debugscript warning when an IFP file contains fewer animations than its header declares.
  • Skip empty entries safely during IFP animation cleanup and lookup.

Guard against null hierarchy and sequence pointers in CIFPAnimations::DeleteAnimations() to avoid crash on disconnect when cleaning up malformed or truncated IFPs.

Switch CClientIFP from premature vector resizing to safe reserve and push_back with remaining buffer bounds checks, and emit a debugscript warning if loaded animations count is less than declared in the header.

Also guard CClientIFP::GetAnimationHierarchy() against null hierarchy pointer.
Copilot AI balanced review requested due to automatic review settings November 16, 2026 16:25

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Copilot was unable to review this pull request because the user who requested the review has insufficient remaining quota. Try requesting a review at a lower effort level.

@MohabCodeX MohabCodeX closed this Nov 16, 2026
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.

2 participants