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

lephilousophe noreply at scummvm.org
Thu May 11 15:42:50 UTC 2023


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

Summary:
f32492c26e BURIED: Check _currentScene before its use


Commit: f32492c26ed0afad8e61797331920d988c3682f7
    https://github.com/scummvm/scummvm/commit/f32492c26ed0afad8e61797331920d988c3682f7
Author: Le Philousophe (lephilousophe at users.noreply.github.com)
Date: 2023-05-11T17:42:24+02:00

Commit Message:
BURIED: Check _currentScene before its use

This fixes CID #1451206, #1451218, #1451237

Changed paths:
    engines/buried/scene_view.cpp


diff --git a/engines/buried/scene_view.cpp b/engines/buried/scene_view.cpp
index fc6cfa69320..caba5bb49bd 100644
--- a/engines/buried/scene_view.cpp
+++ b/engines/buried/scene_view.cpp
@@ -1450,6 +1450,9 @@ bool SceneViewWindow::getCurrentSceneLocation(Location &location) {
 }
 
 bool SceneViewWindow::playSynchronousAnimation(int animationID) {
+	if (!_currentScene)
+		return false;
+
 	TempCursorChange cursorChange(kCursorWait);
 
 	Common::Array<AnimEvent> animDatabase = getAnimationDatabase(_currentScene->_staticData.location.timeZone, _currentScene->_staticData.location.environment);
@@ -1475,7 +1478,7 @@ bool SceneViewWindow::playSynchronousAnimation(int animationID) {
 	if (_globalFlags.bcTranslateEnabled == 1 && animDatabase[i].audioStreamCount > 1)
 		animationMovie->setAudioTrack(2);
 
-	if (_currentScene && _currentScene->movieCallback(this, animationMovie.get(), animationID, MOVIE_START) == SC_FALSE)
+	if (_currentScene->movieCallback(this, animationMovie.get(), animationID, MOVIE_START) == SC_FALSE)
 		return false;
 
 	animationMovie->seekToFrame(animDatabase[i].startFrame);
@@ -1555,6 +1558,9 @@ bool SceneViewWindow::playSynchronousAnimationExtern(int animationID) {
 }
 
 bool SceneViewWindow::playPlacedSynchronousAnimation(int animationID, int left, int top) {
+	if (!_currentScene)
+		return false;
+
 	TempCursorChange cursorChange(kCursorWait);
 
 	Common::Array<AnimEvent> animDatabase = getAnimationDatabase(_currentScene->_staticData.location.timeZone, _currentScene->_staticData.location.environment);
@@ -1582,7 +1588,7 @@ bool SceneViewWindow::playPlacedSynchronousAnimation(int animationID, int left,
 	if (_globalFlags.bcTranslateEnabled == 1 && animDatabase[i].audioStreamCount > 1)
 		animationMovie->setAudioTrack(2);
 
-	if (_currentScene && _currentScene->movieCallback(this, animationMovie.get(), animationID, MOVIE_START) == SC_FALSE)
+	if (_currentScene->movieCallback(this, animationMovie.get(), animationID, MOVIE_START) == SC_FALSE)
 		return false;
 
 	animationMovie->seekToFrame(animDatabase[i].startFrame);
@@ -1622,6 +1628,9 @@ bool SceneViewWindow::playPlacedSynchronousAnimation(int animationID, int left,
 }
 
 bool SceneViewWindow::playClippedSynchronousAnimation(int animationID, int left, int top, int right, int bottom) {
+	if (!_currentScene)
+		return false;
+
 	TempCursorChange cursorChange(kCursorWait);
 
 	Common::Array<AnimEvent> animDatabase = getAnimationDatabase(_currentScene->_staticData.location.timeZone, _currentScene->_staticData.location.environment);
@@ -1652,7 +1661,7 @@ bool SceneViewWindow::playClippedSynchronousAnimation(int animationID, int left,
 	if (_globalFlags.bcTranslateEnabled == 1 && animDatabase[i].audioStreamCount > 1)
 		animationMovie->setAudioTrack(2);
 
-	if (_currentScene && _currentScene->movieCallback(this, animationMovie.get(), animationID, MOVIE_START) == SC_FALSE)
+	if (_currentScene->movieCallback(this, animationMovie.get(), animationID, MOVIE_START) == SC_FALSE)
 		return false;
 
 	animationMovie->seekToFrame(animDatabase[i].startFrame);




More information about the Scummvm-git-logs mailing list