[Scummvm-git-logs] scummvm master -> 7ae7f9384d354374893fc66c0ba6f35bea2b1c2f

rvanlaar noreply at scummvm.org
Thu Aug 29 09:54:15 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:
7ae7f9384d DIRECTOR: Remove usage of EOS in BitmapCastMember


Commit: 7ae7f9384d354374893fc66c0ba6f35bea2b1c2f
    https://github.com/scummvm/scummvm/commit/7ae7f9384d354374893fc66c0ba6f35bea2b1c2f
Author: Roland van Laar (roland at rolandvanlaar.nl)
Date: 2024-08-29T11:49:33+02:00

Commit Message:
DIRECTOR: Remove usage of EOS in BitmapCastMember

BitmapCastMember will keep reading till it hits the EndOfStream marker.
This trailing, or tail, data generates a buildbot notification.
The tail reading is refactored to:
- read the whole tail (with a max of 256 bytes) in one operation and
- to not hit the end of stream.

Changed paths:
    engines/director/castmember/bitmap.cpp


diff --git a/engines/director/castmember/bitmap.cpp b/engines/director/castmember/bitmap.cpp
index c1b325e5b86..bbd24a125b3 100644
--- a/engines/director/castmember/bitmap.cpp
+++ b/engines/director/castmember/bitmap.cpp
@@ -132,22 +132,16 @@ BitmapCastMember::BitmapCastMember(Cast *cast, uint16 castId, Common::SeekableRe
 		if (_bitsPerPixel == 0)
 			_bitsPerPixel = 1;
 
-		int tail = 0;
-		byte buf[256];
-
-		while (!stream.eos()) {
-			byte c = stream.readByte();
-			if (tail < 256)
-				buf[tail] = c;
-			tail++;
-		}
-
-		if (tail)
+		int tail = stream.size() - stream.pos();
+		if (tail > 0) {
 			warning("BUILDBOT: BitmapCastMember: %d bytes left", tail);
-
-		if (tail && debugChannelSet(2, kDebugLoading)) {
-			debug("BitmapCastMember: tail");
-			Common::hexdump(buf, tail);
+			if (debugChannelSet(2, kDebugLoading)) {
+				byte buf[256];
+				tail = MIN(256, tail);
+				stream.read(buf, tail);
+				debug("BitmapCastMember: tail");
+				Common::hexdump(buf, tail);
+			}
 		}
 	} else {
 		warning("STUB: BitmapCastMember::BitmapCastMember(): Bitmaps not yet supported for version %d", version);




More information about the Scummvm-git-logs mailing list