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

aquadran noreply at scummvm.org
Mon Aug 11 07:23:48 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:
e1a49e2ec7 WINTERMUTE: Coverity 1619451


Commit: e1a49e2ec7a3ec206e943637fa2db943b4ff9bc1
    https://github.com/scummvm/scummvm/commit/e1a49e2ec7a3ec206e943637fa2db943b4ff9bc1
Author: Paweł Kołodziejski (aquadran at gmail.com)
Date: 2025-08-11T09:23:42+02:00

Commit Message:
WINTERMUTE: Coverity 1619451

Changed paths:
    engines/wintermute/video/video_player.cpp
    engines/wintermute/video/video_theora_player.cpp


diff --git a/engines/wintermute/video/video_player.cpp b/engines/wintermute/video/video_player.cpp
index 94aecc6c0aa..1f74bd22804 100644
--- a/engines/wintermute/video/video_player.cpp
+++ b/engines/wintermute/video/video_player.cpp
@@ -60,7 +60,7 @@ bool VideoPlayer::setDefaults() {
 
 	_filename.clear();
 
-	_subtitler = new VideoSubtitler(_gameRef);
+	_subtitler = nullptr;
 	_foundSubtitles = false;
 
 	return STATUS_OK;
@@ -69,14 +69,14 @@ bool VideoPlayer::setDefaults() {
 //////////////////////////////////////////////////////////////////////////
 VideoPlayer::~VideoPlayer() {
 	cleanup();
-	delete _subtitler;
-	_subtitler = nullptr;
 }
 
 //////////////////////////////////////////////////////////////////////////
 bool VideoPlayer::cleanup() {
 	_playing = false;
 
+	delete _subtitler;
+	_subtitler = nullptr;
 	if (_aviDecoder) {
 		_aviDecoder->close();
 	}
@@ -109,6 +109,7 @@ bool VideoPlayer::initialize(const Common::String &filename, const Common::Strin
 	_aviDecoder = new Video::AVIDecoder();
 	_aviDecoder->loadStream(file);
 
+	_subtitler = new VideoSubtitler(_gameRef);
 	_foundSubtitles = _subtitler->loadSubtitles(_filename, subtitleFile);
 
 	if (!_aviDecoder->isVideoLoaded()) {
diff --git a/engines/wintermute/video/video_theora_player.cpp b/engines/wintermute/video/video_theora_player.cpp
index b5d2dcc60ea..15ca235c32d 100644
--- a/engines/wintermute/video/video_theora_player.cpp
+++ b/engines/wintermute/video/video_theora_player.cpp
@@ -48,7 +48,6 @@ VideoTheoraPlayer::VideoTheoraPlayer(BaseGame *inGame) : BaseClass(inGame) {
 
 //////////////////////////////////////////////////////////////////////////
 void VideoTheoraPlayer::setDefaults() {
-
 	_filename = "";
 	_startTime = 0;
 	_looping = false;
@@ -82,15 +81,13 @@ void VideoTheoraPlayer::setDefaults() {
 	_volume = 100;
 	_theoraDecoder = nullptr;
 
-	_subtitler = new VideoSubtitler(_gameRef);
+	_subtitler = nullptr;
 	_foundSubtitles = false;
 }
 
 //////////////////////////////////////////////////////////////////////////
 VideoTheoraPlayer::~VideoTheoraPlayer() {
 	cleanup();
-	delete _subtitler;
-	_subtitler = nullptr;
 }
 
 //////////////////////////////////////////////////////////////////////////
@@ -98,6 +95,8 @@ void VideoTheoraPlayer::cleanup() {
 	if (_theoraDecoder) {
 		_theoraDecoder->close();
 	}
+	delete _subtitler;
+	_subtitler = nullptr;
 	delete _theoraDecoder;
 	_theoraDecoder = nullptr;
 	delete _texture;
@@ -124,6 +123,7 @@ bool VideoTheoraPlayer::initialize(const Common::String &filename, const Common:
 	return STATUS_FAILED;
 #endif
 
+	_subtitler = new VideoSubtitler(_gameRef);
 	_foundSubtitles = _subtitler->loadSubtitles(_filename, subtitleFile);
 
 	if (!_theoraDecoder->isVideoLoaded()) {




More information about the Scummvm-git-logs mailing list