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

criezy noreply at scummvm.org
Wed Apr 5 21:24:59 UTC 2023


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:
0d688ba8b8 AGS: Ensure we do not create surfaces with a negative size
07d6ab4c91 VIDEO: Add missing override keyword for setOutputPixelFormat
d2d564125d IMAGE: Add missing override keyword for setOutputPixelFormat


Commit: 0d688ba8b84d98f7ee7abda97bc37361761a74e2
    https://github.com/scummvm/scummvm/commit/0d688ba8b84d98f7ee7abda97bc37361761a74e2
Author: Thierry Crozat (criezy at scummvm.org)
Date: 2023-04-05T22:24:46+01:00

Commit Message:
AGS: Ensure we do not create surfaces with a negative size

I don't know if this happens in practice, but this would trigger an
assert and it doesn't cost much to add the check.

Changed paths:
    engines/ags/lib/allegro/surface.cpp


diff --git a/engines/ags/lib/allegro/surface.cpp b/engines/ags/lib/allegro/surface.cpp
index d4de07dd46c..caa34668d1e 100644
--- a/engines/ags/lib/allegro/surface.cpp
+++ b/engines/ags/lib/allegro/surface.cpp
@@ -451,7 +451,8 @@ BITMAP *create_bitmap_ex(int color_depth, int width, int height) {
 	default:
 		error("Invalid color depth");
 	}
-
+	width = MAX(width, 0);
+	height = MAX(height, 0);
 	BITMAP *bitmap = new Surface(width, height, format);
 	return bitmap;
 }


Commit: 07d6ab4c91783132c23179cafdde64ab91a692ac
    https://github.com/scummvm/scummvm/commit/07d6ab4c91783132c23179cafdde64ab91a692ac
Author: Thierry Crozat (criezy at scummvm.org)
Date: 2023-04-05T22:24:46+01:00

Commit Message:
VIDEO: Add missing override keyword for setOutputPixelFormat

Changed paths:
    video/3do_decoder.h
    video/bink_decoder.h


diff --git a/video/3do_decoder.h b/video/3do_decoder.h
index e6936aff0b9..45a6c9f9b2a 100644
--- a/video/3do_decoder.h
+++ b/video/3do_decoder.h
@@ -75,7 +75,7 @@ private:
 		uint16 getWidth() const override { return _width; }
 		uint16 getHeight() const override { return _height; }
 		Graphics::PixelFormat getPixelFormat() const override;
-		bool setOutputPixelFormat(const Graphics::PixelFormat &format);
+		bool setOutputPixelFormat(const Graphics::PixelFormat &format) override;
 		int getCurFrame() const override { return _curFrame; }
 		int getFrameCount() const override { return _frameCount; }
 		void setNextFrameStartTime(uint32 nextFrameStartTime) { _nextFrameStartTime = nextFrameStartTime; }
diff --git a/video/bink_decoder.h b/video/bink_decoder.h
index e71c9d2fff1..cbf44635f3a 100644
--- a/video/bink_decoder.h
+++ b/video/bink_decoder.h
@@ -153,7 +153,7 @@ private:
 		uint16 getWidth() const override { return _width; }
 		uint16 getHeight() const  override{ return _height; }
 		Graphics::PixelFormat getPixelFormat() const override { return _pixelFormat; }
-		bool setOutputPixelFormat(const Graphics::PixelFormat &format) { _pixelFormat = format; return true; }
+		bool setOutputPixelFormat(const Graphics::PixelFormat &format) override { _pixelFormat = format; return true; }
 		int getCurFrame() const override { return _curFrame; }
 		int getFrameCount() const override { return _frameCount; }
 		const Graphics::Surface *decodeNextFrame() override { return _surface; }


Commit: d2d564125d53109bfd1d09a23fd1df386f018846
    https://github.com/scummvm/scummvm/commit/d2d564125d53109bfd1d09a23fd1df386f018846
Author: Thierry Crozat (criezy at scummvm.org)
Date: 2023-04-05T22:24:46+01:00

Commit Message:
IMAGE: Add missing override keyword for setOutputPixelFormat

Changed paths:
    image/codecs/indeo/indeo.h


diff --git a/image/codecs/indeo/indeo.h b/image/codecs/indeo/indeo.h
index dc543e74ad5..ac35010a8f9 100644
--- a/image/codecs/indeo/indeo.h
+++ b/image/codecs/indeo/indeo.h
@@ -540,7 +540,7 @@ protected:
 	 * Select the preferred format to use, for codecs where this is faster than converting
 	 * the image afterwards. Returns true if supported, and false otherwise.
 	 */
-	bool setOutputPixelFormat(const Graphics::PixelFormat &format) { _pixelFormat = format; return true; }
+	bool setOutputPixelFormat(const Graphics::PixelFormat &format) override { _pixelFormat = format; return true; }
 
 	/**
 	 * Decode the Indeo picture header.




More information about the Scummvm-git-logs mailing list