[Scummvm-git-logs] scummvm master -> 007e377148274fc8a571abc2930b8f348d9ea6e2

Strangerke noreply at scummvm.org
Fri May 17 21:33:59 UTC 2024


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:
007e377148 BAGEL: Add a check to avoid a potential null dereferencing in CBagRestoreDialog(CID 1544883)


Commit: 007e377148274fc8a571abc2930b8f348d9ea6e2
    https://github.com/scummvm/scummvm/commit/007e377148274fc8a571abc2930b8f348d9ea6e2
Author: Strangerke (arnaud.boutonne at gmail.com)
Date: 2024-05-17T22:33:53+01:00

Commit Message:
BAGEL: Add a check to avoid a potential null dereferencing in CBagRestoreDialog(CID 1544883)

Changed paths:
    engines/bagel/dialogs/restore_dialog.cpp


diff --git a/engines/bagel/dialogs/restore_dialog.cpp b/engines/bagel/dialogs/restore_dialog.cpp
index d919ef4eb9d..35f965910c6 100644
--- a/engines/bagel/dialogs/restore_dialog.cpp
+++ b/engines/bagel/dialogs/restore_dialog.cpp
@@ -95,10 +95,14 @@ ErrorCode CBagRestoreDialog::attach() {
 	// Save off the current game's palette
 	_pSavePalette = CBofApp::getApp()->getPalette();
 
-	// Insert ours
-	CBofPalette *pPal = _pBackdrop->getPalette();
-	CBofApp::getApp()->setPalette(pPal);
+	CBofPalette *pPal = nullptr;
 
+	// Insert ours
+	if (_pBackdrop != nullptr) {
+		pPal = _pBackdrop->getPalette();
+		CBofApp::getApp()->setPalette(pPal);
+	}
+	
 	// Paint the SaveList Box onto the background
 	if (_pBackdrop != nullptr) {
 		CBofBitmap cBmp(buildSysDir("SAVELIST.BMP"), pPal);




More information about the Scummvm-git-logs mailing list