[Scummvm-git-logs] scummvm master -> 779980fd76e10edda431a4ed8874be8adb5b520b

ccawley2011 noreply at scummvm.org
Wed Apr 8 15:58:36 UTC 2026


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:
779980fd76 GRAPHICS: Check the return value when clipping in ManagedSurface functions


Commit: 779980fd76e10edda431a4ed8874be8adb5b520b
    https://github.com/scummvm/scummvm/commit/779980fd76e10edda431a4ed8874be8adb5b520b
Author: Cameron Cawley (ccawley2011 at gmail.com)
Date: 2026-04-08T16:58:20+01:00

Commit Message:
GRAPHICS: Check the return value when clipping in ManagedSurface functions

Changed paths:
    graphics/managed_surface.cpp


diff --git a/graphics/managed_surface.cpp b/graphics/managed_surface.cpp
index 467df2ae585..4a3f1e9a701 100644
--- a/graphics/managed_surface.cpp
+++ b/graphics/managed_surface.cpp
@@ -398,7 +398,8 @@ void ManagedSurface::simpleBlitFromInner(const Surface &src, const Common::Rect
 	Common::Rect dstRectC = srcRect;
 
 	dstRectC.moveTo(destPos.x, destPos.y);
-	clip(srcRectC, dstRectC, src.w, src.h, flip);
+	if (!clip(srcRectC, dstRectC, src.w, src.h, flip))
+		return;
 
 	const byte *srcPtr = (const byte *)src.getBasePtr(srcRectC.left, srcRectC.top);
 	byte *dstPtr = (byte *)getBasePtr(dstRectC.left, dstRectC.top);
@@ -498,7 +499,8 @@ void ManagedSurface::maskBlitFromInner(const Surface &src, const Surface &mask,
 	Common::Rect dstRectC = srcRect;
 
 	dstRectC.moveTo(destPos.x, destPos.y);
-	clip(srcRectC, dstRectC, src.w, src.h, flip);
+	if (!clip(srcRectC, dstRectC, src.w, src.h, flip))
+		return;
 
 	const byte *srcPtr = (const byte *)src.getBasePtr(srcRectC.left, srcRectC.top);
 	const byte *maskPtr = (const byte *)mask.getBasePtr(srcRectC.left, srcRectC.top);




More information about the Scummvm-git-logs mailing list