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
This commit is contained in:
Matej Knopp
2023-05-30 23:37:12 +02:00
committed by GitHub
parent e927e5488f
commit 821bb52e38

View File

@@ -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);
}