[Scummvm-git-logs] scummvm master -> 993d73e43091ec1f4f097acc3dd4a546bb34f9c0

criezy criezy at scummvm.org
Thu Apr 1 00:09:45 UTC 2021


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

Summary:
33b918c8b5 AGS: Use backend preferred pixel format
329351a279 AGS: Fix access to uninitialized memory
993d73e430 AGS: Fix deletion of non-array variable


Commit: 33b918c8b583c00d5e57d35746c0a1e3af35de5a
    https://github.com/scummvm/scummvm/commit/33b918c8b583c00d5e57d35746c0a1e3af35de5a
Author: Thierry Crozat (criezy at scummvm.org)
Date: 2021-04-01T00:39:00+01:00

Commit Message:
AGS: Use backend preferred pixel format

This fixes using the engine on iOS.

Changed paths:
    engines/ags/ags.cpp


diff --git a/engines/ags/ags.cpp b/engines/ags/ags.cpp
index ea686a9927..d9597ba513 100644
--- a/engines/ags/ags.cpp
+++ b/engines/ags/ags.cpp
@@ -189,8 +189,13 @@ SaveStateList AGSEngine::listSaves() const {
 }
 
 void AGSEngine::setGraphicsMode(size_t w, size_t h) {
-	Graphics::PixelFormat FORMAT(4, 8, 8, 8, 8, 24, 16, 8, 0);
-	initGraphics(w, h, &FORMAT);
+	Common::List<Graphics::PixelFormat> supportedFormatsList = g_system->getSupportedFormats();
+	Graphics::PixelFormat format;
+	if (!supportedFormatsList.empty())
+		format = supportedFormatsList.front();
+	else
+		format = Graphics::PixelFormat(4, 8, 8, 8, 8, 24, 16, 8, 0);
+	initGraphics(w, h, &format);
 
 	_rawScreen = new Graphics::Screen();
 	_screen = new ::AGS3::BITMAP(_rawScreen);


Commit: 329351a279e5a7edb51df17556b81c876a34f262
    https://github.com/scummvm/scummvm/commit/329351a279e5a7edb51df17556b81c876a34f262
Author: Thierry Crozat (criezy at scummvm.org)
Date: 2021-04-01T00:54:46+01:00

Commit Message:
AGS: Fix access to uninitialized memory

This is a regression from 3a3f31cd56.
Global variables are initialized to 0 implicitly, but class
variables are not. So those two pointers were no longer
initialized to nullptr, causing possible use of uninitialized
memory and then of unallocated memory when trying to access
what they were pointing to. This caused random crashes in
paletted games.

Changed paths:
    engines/ags/globals.h


diff --git a/engines/ags/globals.h b/engines/ags/globals.h
index ba2d8d23db..ee743f3e0b 100644
--- a/engines/ags/globals.h
+++ b/engines/ags/globals.h
@@ -185,8 +185,8 @@ public:
 	int __rgb_b_shift_32 = DEFAULT_RGB_B_SHIFT_32;
 	int __rgb_a_shift_32 = DEFAULT_RGB_A_SHIFT_32;
 
-	RGB_MAP *_rgb_map;
-	COLOR_MAP *_color_map;
+	RGB_MAP *_rgb_map = nullptr;
+	COLOR_MAP *_color_map = nullptr;
 	int _trans_blend_alpha = 0;
 	int _trans_blend_red = 0;
 	int _trans_blend_green = 0;


Commit: 993d73e43091ec1f4f097acc3dd4a546bb34f9c0
    https://github.com/scummvm/scummvm/commit/993d73e43091ec1f4f097acc3dd4a546bb34f9c0
Author: Thierry Crozat (criezy at scummvm.org)
Date: 2021-04-01T01:05:28+01:00

Commit Message:
AGS: Fix deletion of non-array variable

Changed paths:
    engines/ags/globals.cpp


diff --git a/engines/ags/globals.cpp b/engines/ags/globals.cpp
index 5905981149..554d66aa2d 100644
--- a/engines/ags/globals.cpp
+++ b/engines/ags/globals.cpp
@@ -383,7 +383,7 @@ Globals::~Globals() {
 	delete _thingsToDrawList;
 	delete[] _dynamicallyCreatedSurfaces;
 	delete[] _palette;
-	delete[] _maincoltable;
+	delete _maincoltable;
 
 	// draw_software.cpp globals
 	delete _BlackRects;




More information about the Scummvm-git-logs mailing list