From 821bb52e383b3ad871f82a42eed5f28d193d2672 Mon Sep 17 00:00:00 2001 From: Matej Knopp Date: Tue, 30 May 2023 23:37:12 +0200 Subject: [PATCH] Fix unitialized SkRect (flutter/engine#42403) Empty SkRect needs to be created with `SkRect::MakeEmpty()` otherwise the default value is undefined (and possibly garbage). *If you had to change anything in the [flutter/tests] repo, include a link to the migration guide as per the [breaking change policy].* [C++, Objective-C, Java style guides]: https://github.com/flutter/engine/blob/main/CONTRIBUTING.md#style --- .../darwin/ios/framework/Source/FlutterPlatformViews.mm | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterPlatformViews.mm b/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterPlatformViews.mm index 51349cb70e..784045f1b6 100644 --- a/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterPlatformViews.mm +++ b/engine/src/flutter/shell/platform/darwin/ios/framework/Source/FlutterPlatformViews.mm @@ -703,7 +703,7 @@ bool FlutterPlatformViewsController::SubmitFrame(GrDirectContext* gr_context, // TODO(egarciad): Consider making this configurable. // https://github.com/flutter/flutter/issues/52510 if (allocation_size > kMaxLayerAllocations) { - SkRect joined_rect; + SkRect joined_rect = SkRect::MakeEmpty(); for (const SkRect& rect : intersection_rects) { joined_rect.join(rect); }