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

somaen noreply at scummvm.org
Sun Mar 26 19:40:36 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:
b355ff7469 DIRECTOR: Don't assume that palette exists based on paletteColorCount


Commit: b355ff7469c47766de9dd0f4d964adadc8db858c
    https://github.com/scummvm/scummvm/commit/b355ff7469c47766de9dd0f4d964adadc8db858c
Author: Einar Johan Trøan Sømåen (somaen at scummvm.org)
Date: 2023-03-26T21:40:15+02:00

Commit Message:
DIRECTOR: Don't assume that palette exists based on paletteColorCount

Changed paths:
    engines/director/picture.cpp


diff --git a/engines/director/picture.cpp b/engines/director/picture.cpp
index 04d4db10139..c720a775996 100644
--- a/engines/director/picture.cpp
+++ b/engines/director/picture.cpp
@@ -41,9 +41,13 @@ Picture::~Picture() {
 
 void Picture::copyPalette(const byte *src, int numColors) {
 	delete[] _palette;
-	_paletteColors = numColors;
-	_palette = new byte[getPaletteSize()]();
-	memcpy(_palette, src, getPaletteSize());
+	if (src) {
+		_paletteColors = numColors;
+		_palette = new byte[getPaletteSize()]();
+		memcpy(_palette, src, getPaletteSize());
+	} else {
+		_paletteColors = 0;
+	}
 }
 
 } // End of namespace Director




More information about the Scummvm-git-logs mailing list