From f6d868ede0db30e52bb3be332f7678379b9155df Mon Sep 17 00:00:00 2001 From: Kaushik Iska Date: Thu, 21 Nov 2019 19:40:06 -0800 Subject: [PATCH] [fuchsia] Ensure we do not initialize nan RoundedRectangles (flutter/engine#13971) Also initializes physical shape layer vars to empty. --- engine/src/flutter/flow/scene_update_context.cc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/engine/src/flutter/flow/scene_update_context.cc b/engine/src/flutter/flow/scene_update_context.cc index 14190b5b5d6..1c85bb658aa 100644 --- a/engine/src/flutter/flow/scene_update_context.cc +++ b/engine/src/flutter/flow/scene_update_context.cc @@ -71,6 +71,13 @@ void SceneUpdateContext::CreateFrame(scenic::EntityNode entity_node, if (rrect.isEmpty()) return; + // isEmpty should account for this, but we are adding these experimental + // checks to validate if this is the root cause for b/144933519. + if (std::isnan(rrect.width()) || std::isnan(rrect.height())) { + FML_LOG(ERROR) << "Invalid RoundedRectangle"; + return; + } + // Add a part which represents the frame's geometry for clipping purposes // and possibly for its texture. // TODO(SCN-137): Need to be able to express the radii as vectors.