From 0f2d5f91dc207190d60a5a1bee4ca1d19707e224 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Mon, 10 Oct 2022 23:42:15 +0200 Subject: [PATCH] LibWeb: Fix two uninitialized variables in FormattingContext --- Userland/Libraries/LibWeb/Layout/FormattingContext.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Userland/Libraries/LibWeb/Layout/FormattingContext.cpp b/Userland/Libraries/LibWeb/Layout/FormattingContext.cpp index 6c32da57bd..baefe311ff 100644 --- a/Userland/Libraries/LibWeb/Layout/FormattingContext.cpp +++ b/Userland/Libraries/LibWeb/Layout/FormattingContext.cpp @@ -1058,7 +1058,7 @@ float FormattingContext::calculate_min_content_height(Layout::Box const& box, Av return *box.intrinsic_height(); bool is_cacheable = available_width.is_definite() || available_width.is_intrinsic_sizing_constraint(); - Optional* cache_slot; + Optional* cache_slot = nullptr; if (is_cacheable) { auto& root_state = m_state.m_root; auto& cache = *root_state.intrinsic_sizes.ensure(&box, [] { return adopt_own(*new LayoutState::IntrinsicSizes); }); @@ -1103,7 +1103,7 @@ float FormattingContext::calculate_max_content_height(Layout::Box const& box, Av return *box.intrinsic_height(); bool is_cacheable = available_width.is_definite() || available_width.is_intrinsic_sizing_constraint(); - Optional* cache_slot; + Optional* cache_slot = nullptr; if (is_cacheable) { auto& root_state = m_state.m_root; auto& cache = *root_state.intrinsic_sizes.ensure(&box, [] { return adopt_own(*new LayoutState::IntrinsicSizes); });