Skip to content

Fix segfault with image overlay when restarting a room. - #1152

Merged
mrimer merged 1 commit into
masterfrom
image-overlay-segfault
May 8, 2026
Merged

Fix segfault with image overlay when restarting a room.#1152
mrimer merged 1 commit into
masterfrom
image-overlay-segfault

Conversation

@EvidentlyCube

Copy link
Copy Markdown
Collaborator

ISSUE: When you have an image overlay command that cancels a layer AND another on the same layer that has Loop -1, restarting the room can cause a segfault.

DIAGNOSIS: The exact issue was in DisplayPersistingImageOverlays; if there were two private datas and the first image overlay cleared the second one we ended up with no private data. But then pObj = CueEvents.GetFirstPrivateData(cid); would set pObj to null causing a segfault due to playing with deleted/undefiend memory.

SOLUTION: Moved the proceeding to the next private data to the end of effect removing code.

REFERENCE: https://forum.caravelgames.com/viewtopic.php?TopicID=47386

ISSUE: When you have an image overlay command that cancels a layer AND another on the same layer that has `Loop -1`, restarting the room can cause a segfault.

DIAGNOSIS: The exact issue was in `DisplayPersistingImageOverlays`; if there were two private datas and the first image overlay cleared the second one we ended up with no private data. But then `pObj = CueEvents.GetFirstPrivateData(cid);` would set `pObj` to null causing a segfault due to playing with deleted/undefiend memory.

SOLUTION: Moved the proceeding to the next private data to the end of effect removing code.
@mrimer
mrimer merged commit 81933cf into master May 8, 2026
1 check passed
@Hypexion
Hypexion deleted the image-overlay-segfault branch May 8, 2026 17:41
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