Skip to content

fix(core): add null frame guards to RwFrameRotate and gauge indicators - #337

Open
CanerKaraca23 wants to merge 1 commit into
user-grinch:mainfrom
CanerKaraca23:fix/core-null-frame-guards
Open

CanerKaraca23 wants to merge 1 commit into
user-grinch:mainfrom
CanerKaraca23:fix/core-null-frame-guards

Conversation

@CanerKaraca23

Copy link
Copy Markdown
Collaborator

Summary

Adds defensive null pointer checks across core frame rotation utilities and vehicle gauge indicators to prevent access violation crashes during vehicle frame manipulation.

Problem

When third-party plugins (such as VehFuncs or VehIK) detach or hide optional vehicle model frames, or when models stream in with missing odometer drum frames, passing nullptr to RwFrameRotate dereferences frame->modelling at offset +0x1C, causing an access violation crash 0xC0000005 at 0x007F1F1F.

Changes

  • src/utils/frame.cpp: Added if (!frame) return; guard to FrameUtil::SetRotationX, SetRotationY, and SetRotationZ.
  • src/features/core/dummy.h: Added && data.frame guard in VehicleDummy::AddAngle and VehicleDummy::ReduceAngle.
  • src/features/gauge.cpp: Added null frame pointer check (indicator.vecFrameList[i]) before rotating odometer drum frames in MileageIndicator::Init.

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.

1 participant