mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-04-21 12:05:15 +00:00
LibHTML: LayoutImage should not dereference a null bitmap
This was happening when trying to render a bitmap that we couldn't decode properly.
This commit is contained in:
parent
89a0d873ba
commit
a12292bd03
Notes:
sideshowbarker
2024-07-19 11:09:02 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/a12292bd03c
1 changed files with 1 additions and 2 deletions
|
@ -48,9 +48,8 @@ void LayoutImage::render(RenderingContext& context)
|
|||
if (alt.is_empty())
|
||||
alt = node().src();
|
||||
context.painter().draw_text(enclosing_int_rect(rect()), alt, TextAlignment::Center, style().color_or_fallback(CSS::PropertyID::Color, document(), Color::Black), TextElision::Right);
|
||||
} else {
|
||||
} else if (node().bitmap())
|
||||
context.painter().draw_scaled_bitmap(enclosing_int_rect(rect()), *node().bitmap(), node().bitmap()->rect());
|
||||
}
|
||||
LayoutReplaced::render(context);
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue