mirror of
https://github.com/RGBCube/serenity
synced 2025-07-23 10:17:41 +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
1 changed files with 1 additions and 2 deletions
|
@ -48,9 +48,8 @@ void LayoutImage::render(RenderingContext& context)
|
||||||
if (alt.is_empty())
|
if (alt.is_empty())
|
||||||
alt = node().src();
|
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);
|
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());
|
context.painter().draw_scaled_bitmap(enclosing_int_rect(rect()), *node().bitmap(), node().bitmap()->rect());
|
||||||
}
|
|
||||||
LayoutReplaced::render(context);
|
LayoutReplaced::render(context);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue