aboutsummaryrefslogtreecommitdiff
path: root/src/cmd/devdraw
diff options
context:
space:
mode:
Diffstat (limited to 'src/cmd/devdraw')
-rw-r--r--src/cmd/devdraw/cocoa-screen-metal.m4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/cmd/devdraw/cocoa-screen-metal.m b/src/cmd/devdraw/cocoa-screen-metal.m
index 21123f16..78110302 100644
--- a/src/cmd/devdraw/cocoa-screen-metal.m
+++ b/src/cmd/devdraw/cocoa-screen-metal.m
@@ -987,6 +987,10 @@ void
_flushmemscreen(Rectangle r)
{
LOG(@"_flushmemscreen(%d,%d,%d,%d)", r.min.x, r.min.y, Dx(r), Dy(r));
+ if(!rectinrect(r, Rect(0, 0, texture.width, texture.height))){
+ LOG(@"Rectangle is out of bounds, return.");
+ return;
+ }
@autoreleasepool{
[texture