[Scummvm-git-logs] scummvm master -> 80b895bdebd912dc8240da3b40611b433ceebb7f

criezy noreply at scummvm.org
Mon Jun 9 22:57:20 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:
80b895bdeb SUPERNOVA: Fix crash when loading images


Commit: 80b895bdebd912dc8240da3b40611b433ceebb7f
    https://github.com/scummvm/scummvm/commit/80b895bdebd912dc8240da3b40611b433ceebb7f
Author: Thierry Crozat (criezy at scummvm.org)
Date: 2025-06-09T23:56:37+01:00

Commit Message:
SUPERNOVA: Fix crash when loading images

This was a regression from 77ee5a9.

Changed paths:
    engines/supernova/graphics.cpp


diff --git a/engines/supernova/graphics.cpp b/engines/supernova/graphics.cpp
index 823b98dd7a0..50b5283ce53 100644
--- a/engines/supernova/graphics.cpp
+++ b/engines/supernova/graphics.cpp
@@ -155,10 +155,12 @@ bool MSNImage::loadStream(Common::SeekableReadStream &stream) {
 		_palette.set(47, 0xE0, 0xE0, 0xE0);
 	} else {
 		pal_diff = 1;
-		byte r = stream.readByte() << 2;
-		byte g = stream.readByte() << 2;
-		byte b = stream.readByte() << 2;
-		_palette.set(239 - flag, r, g, b);
+		for (int i = flag; i != 0; --i) {
+			byte r = stream.readByte() << 2;
+			byte g = stream.readByte() << 2;
+			byte b = stream.readByte() << 2;
+			_palette.set(239 - i, r, g, b);
+		}
 	}
 
 	_numSections = stream.readByte();




More information about the Scummvm-git-logs mailing list