Skip to content

Commit

Permalink
Null-check LayoutObject in InvalidateFilterData
Browse files Browse the repository at this point in the history
In some Destroy() code-paths (in this specific case
LayoutObjectChildList::DestroyLeftoverChildren) the LayoutObject pointer
in Element (Node) will have been cleared before Destroy() is called, so
since we access the LayoutObject via the Element in this function we
need to make sure it's still present (even though we have the
LayoutObject a bit further up the callstack).

Bug: 1191089
Change-Id: I7ba46e8b06205fc09d975c4aa8a73cb448379039
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2780670
Reviewed-by: Stephen Chenney <schenney@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#866040}
  • Loading branch information
Fredrik Söderqvist authored and Chromium LUCI CQ committed Mar 24, 2021
1 parent b126e77 commit 9df35e1
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions third_party/blink/renderer/core/layout/svg/svg_resources.cc
Original file line number Diff line number Diff line change
Expand Up @@ -350,9 +350,10 @@ void SVGElementResourceClient::InvalidateFilterData() {
return;
if (FilterData* filter_data = filter_data_.Release())
filter_data->Dispose();
LayoutObject* layout_object = element_->GetLayoutObject();
layout_object->SetNeedsPaintPropertyUpdate();
MarkFilterDataDirty();
if (LayoutObject* layout_object = element_->GetLayoutObject()) {
layout_object->SetNeedsPaintPropertyUpdate();
MarkFilterDataDirty();
}
}

void SVGElementResourceClient::MarkFilterDataDirty() {
Expand Down

0 comments on commit 9df35e1

Please sign in to comment.