Fix last argument in calls to dCamera_c::startEventCamera

The last argument is used as a char*, so we need to explicitly
pass nullptr instead of 0 to ensure it has the correct type.
This was causing crashes due to va_arg reading 8 bytes when only 4
were provided by the caller - if the out-of-bounds bytes are
non-zero, the null check fails and it continues pulling args from
beyond the argument buffer potentially triggering a segfault.
This commit is contained in:
Max Roncace
2026-03-20 02:51:29 -04:00
parent 91d8e422ac
commit 7ae18f3a9d
10 changed files with 17 additions and 17 deletions
+1 -1
View File
@@ -577,7 +577,7 @@ void daNpcTkc_c::reset() {
setAngle(fopAcM_searchPlayerAngleY(this));
static int const m_cameraItemNum = 1;
dCam_getBody()->StartEventCamera(18, fopAcM_GetID(this), "Type", 1, &m_cameraItemNum, 0);
dCam_getBody()->StartEventCamera(18, fopAcM_GetID(this), "Type", 1, &m_cameraItemNum, nullptr);
} else if (parentActorID == fpcM_ERROR_PROCESS_ID_e) {
home.pos.y += mpHIO->m.target_height;
} else {