Assert NULL pointer/marker args in cutscenesystem.c entry points

Matches the existing assertNotNull convention in cutscene.c
(cutsceneAppend/cutsceneParseDoc etc.) - these are internal-API
preconditions on trusted callers, not untrusted input.

Co-Authored-By: Claude Sonnet 5 <[email protected]>
This commit is contained in:
2026-09-18 09:09:35 -05:00
co-authored by Claude Sonnet 5
parent 4279bd9675
commit abf6863044
+10
View File
@@ -45,6 +45,8 @@ void cutsceneSystemPrepare(
entity_t *interact, entity_t *interact,
entity_t *interacted entity_t *interacted
) { ) {
assertNotNull(cutscene, "Cutscene cannot be NULL");
CUTSCENE_SYSTEM.scene = cutscene; CUTSCENE_SYSTEM.scene = cutscene;
CUTSCENE_SYSTEM.pause = cutscene->pause; CUTSCENE_SYSTEM.pause = cutscene->pause;
CUTSCENE_SYSTEM.entityInteract = interact; CUTSCENE_SYSTEM.entityInteract = interact;
@@ -75,11 +77,14 @@ void cutsceneSystemStartCutsceneAndGoToMarker(
cutscene_t *cutscene, cutscene_t *cutscene,
const char_t *marker const char_t *marker
) { ) {
assertNotNull(marker, "Marker cannot be NULL");
cutsceneSystemPrepare(cutscene, NULL, NULL); cutsceneSystemPrepare(cutscene, NULL, NULL);
cutsceneGoTo(marker); cutsceneGoTo(marker);
} }
void cutsceneSystemInsertCutscene(const cutscene_t *cutscene) { void cutsceneSystemInsertCutscene(const cutscene_t *cutscene) {
assertNotNull(cutscene, "Cutscene cannot be NULL");
assertNotNull( assertNotNull(
CUTSCENE_SYSTEM.scene, CUTSCENE_SYSTEM.scene,
"cutsceneSystemInsertCutscene called with no cutscene running" "cutsceneSystemInsertCutscene called with no cutscene running"
@@ -93,6 +98,8 @@ void cutsceneSystemInsertCutscene(const cutscene_t *cutscene) {
} }
void cutsceneSystemLoad(const char_t *file) { void cutsceneSystemLoad(const char_t *file) {
assertNotNull(file, "File cannot be NULL");
char_t path[ASSET_FILE_NAME_MAX]; char_t path[ASSET_FILE_NAME_MAX];
stringFormat(path, sizeof(path), "cutscenes/%s", file); stringFormat(path, sizeof(path), "cutscenes/%s", file);
@@ -231,6 +238,8 @@ const char_t * cutsceneSystemGetTextCache(void) {
} }
void cutsceneSystemSetTextCache(const char_t *text) { void cutsceneSystemSetTextCache(const char_t *text) {
assertNotNull(text, "Text cannot be NULL");
stringCopy( stringCopy(
CUTSCENE_SYSTEM.textCache, text, CUTSCENE_TEXT_CACHE_MAX - 1 CUTSCENE_SYSTEM.textCache, text, CUTSCENE_TEXT_CACHE_MAX - 1
); );
@@ -277,6 +286,7 @@ void cutsceneSystemNext() {
} }
void cutsceneGoTo(const char_t *name) { void cutsceneGoTo(const char_t *name) {
assertNotNull(name, "Name cannot be NULL");
assertNotNull( assertNotNull(
CUTSCENE_SYSTEM.scene, "cutsceneGoTo called with no cutscene running" CUTSCENE_SYSTEM.scene, "cutsceneGoTo called with no cutscene running"
); );