From 525e9e9dedff46578ddb4069c133a0eb33ff1a2d Mon Sep 17 00:00:00 2001 From: Anthony Nicholls Date: Wed, 28 Feb 2024 09:05:33 +0000 Subject: [PATCH] macOS: Prevent an empty RectangleList from incorrectly filling a graphics context --- modules/juce_graphics/native/juce_CoreGraphicsContext_mac.mm | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/juce_graphics/native/juce_CoreGraphicsContext_mac.mm b/modules/juce_graphics/native/juce_CoreGraphicsContext_mac.mm index b37f47e847..e9be41c3da 100644 --- a/modules/juce_graphics/native/juce_CoreGraphicsContext_mac.mm +++ b/modules/juce_graphics/native/juce_CoreGraphicsContext_mac.mm @@ -593,6 +593,9 @@ void CoreGraphicsContext::drawLine (const Line& line) void CoreGraphicsContext::fillRectList (const RectangleList& list) { + if (list.isEmpty()) + return; + std::vector rects; rects.reserve ((size_t) list.getNumRectangles());