From be73e88f17ed3db63c53c72c320bcec0949eed9b Mon Sep 17 00:00:00 2001 From: Brandon DeRosier Date: Thu, 25 May 2023 09:32:23 -0700 Subject: [PATCH] [Impeller] Safely access snapshot in the pipeline blend filter (flutter/engine#42314) Spotted by @zanderso. --- .../impeller/entity/contents/filters/blend_filter_contents.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/engine/src/flutter/impeller/entity/contents/filters/blend_filter_contents.cc b/engine/src/flutter/impeller/entity/contents/filters/blend_filter_contents.cc index 1c320657e8..287ec60ee3 100644 --- a/engine/src/flutter/impeller/entity/contents/filters/blend_filter_contents.cc +++ b/engine/src/flutter/impeller/entity/contents/filters/blend_filter_contents.cc @@ -484,6 +484,9 @@ static std::optional PipelineBlend( auto dst_snapshot = inputs[0]->GetSnapshot("PipelineBlend(Dst)", renderer, entity); + if (!dst_snapshot.has_value()) { + return std::nullopt; + } ContentContext::SubpassCallback callback = [&](const ContentContext& renderer, RenderPass& pass) {