[Scummvm-git-logs] scummvm master -> c4b7b76bc31b728470f540d049cab2c4147f6c44

sluicebox noreply at scummvm.org
Wed Nov 5 21:39:38 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:
c4b7b76bc3 PRIVATE: Fix SDL Surface when subtitles enabled


Commit: c4b7b76bc31b728470f540d049cab2c4147f6c44
    https://github.com/scummvm/scummvm/commit/c4b7b76bc31b728470f540d049cab2c4147f6c44
Author: sluicebox (22204938+sluicebox at users.noreply.github.com)
Date: 2025-11-05T13:39:34-08:00

Commit Message:
PRIVATE: Fix SDL Surface when subtitles enabled

Fixes bug #16217

Changed paths:
    engines/private/private.cpp


diff --git a/engines/private/private.cpp b/engines/private/private.cpp
index dc5ba338d70..a13b7cf7c6b 100644
--- a/engines/private/private.cpp
+++ b/engines/private/private.cpp
@@ -240,9 +240,7 @@ Common::Error PrivateEngine::run() {
 	if (!Common::parseBool(ConfMan.get("sfxSubtitles"), _sfxSubtitles))
 		warning("Failed to parse bool from sfxSubtitles options");
 
-	if (_useSubtitles) {
-		g_system->showOverlay(false);
-	} else if (_sfxSubtitles) {
+	if (!_useSubtitles && _sfxSubtitles) {
 		warning("SFX subtitles are enabled, but no subtitles will be shown");
 	}
 
@@ -439,9 +437,11 @@ Common::Error PrivateEngine::run() {
 				_videoDecoder->close();
 				delete _videoDecoder;
 				_videoDecoder = nullptr;
-				delete _subtitles;
-				_subtitles = nullptr;
-				g_system->clearOverlay();
+				if (_subtitles != nullptr) {
+					delete _subtitles;
+					_subtitles = nullptr;
+					g_system->clearOverlay();
+				}
 				_currentMovie = "";
 			} else if (!_videoDecoder->needsUpdate() && needsUpdate) {
 				g_system->updateScreen();
@@ -467,7 +467,7 @@ Common::Error PrivateEngine::run() {
 
 		g_system->updateScreen();
 		g_system->delayMillis(10);
-		if (_subtitles) {
+		if (_subtitles != nullptr) {
 			if (_mixer->isSoundHandleActive(_fgSoundHandle)) {
 				_subtitles->drawSubtitle(_mixer->getElapsedTime(_fgSoundHandle).msecs(), false, _sfxSubtitles);
 			} else {
@@ -1570,7 +1570,7 @@ void PrivateEngine::loadSubtitles(const Common::Path &path) {
 		_subtitles->loadSRTFile(subPath);
 		g_system->showOverlay(false);
 		adjustSubtitleSize();
-	} else {
+	} else if (_subtitles != nullptr) {
 		delete _subtitles;
 		_subtitles = nullptr;
 		g_system->clearOverlay();
@@ -1596,9 +1596,11 @@ void PrivateEngine::skipVideo() {
 	_videoDecoder->close();
 	delete _videoDecoder;
 	_videoDecoder = nullptr;
-	delete _subtitles;
-	_subtitles = nullptr;
-	g_system->clearOverlay();
+	if (_subtitles != nullptr) {
+		delete _subtitles;
+		_subtitles = nullptr;
+		g_system->clearOverlay();
+	}
 	_currentMovie = "";
 }
 




More information about the Scummvm-git-logs mailing list