[Scummvm-git-logs] scummvm master -> 095edf14f9589e2ce7199260e10d5e2a0b833455

sluicebox noreply at scummvm.org
Thu Nov 6 09:42:16 UTC 2025


This automated email contains information about 1 new commit which have been
pushed to the 'scummvm' repo located at https://api.github.com/repos/scummvm/scummvm .

Summary:
095edf14f9 PRIVATE: Fix kActionSkip when video paused


Commit: 095edf14f9589e2ce7199260e10d5e2a0b833455
    https://github.com/scummvm/scummvm/commit/095edf14f9589e2ce7199260e10d5e2a0b833455
Author: sluicebox (22204938+sluicebox at users.noreply.github.com)
Date: 2025-11-06T01:41:48-08:00

Commit Message:
PRIVATE: Fix kActionSkip when video paused

Pressing escape on the desktop interface while a video is paused
causes the video in the background to be skipped and its decoder
deleted. Before the recent memory leak fixes, there would be no
video when returning from the desktop interface.

Now that we don't leak video decoders, the dangling pointer in
_pausedVideo causes a double free and a crash when resuming.

Fixed by ignoring kActionSkip when video is paused.

Changed paths:
    engines/private/private.cpp


diff --git a/engines/private/private.cpp b/engines/private/private.cpp
index 1f850c2a852..ec77f04f57a 100644
--- a/engines/private/private.cpp
+++ b/engines/private/private.cpp
@@ -337,7 +337,7 @@ Common::Error PrivateEngine::run() {
 			// Events
 			switch (event.type) {
 			case Common::EVENT_CUSTOM_ENGINE_ACTION_START:
-				if (event.customType == kActionSkip && _videoDecoder) {
+				if (event.customType == kActionSkip) {
 					skipVideo();
 				}
 				break;
@@ -1584,6 +1584,10 @@ void PrivateEngine::playVideo(const Common::String &name) {
 }
 
 void PrivateEngine::skipVideo() {
+	if (_videoDecoder == nullptr || _videoDecoder->isPaused()) {
+		return;
+	}
+
 	delete _videoDecoder;
 	_videoDecoder = nullptr;
 	if (_subtitles != nullptr) {




More information about the Scummvm-git-logs mailing list