Commit 0ba42c9a authored by Fredrik Söderquist's avatar Fredrik Söderquist Committed by Commit Bot

Check Image from StyleImage::GetImage in NinePieceImagePainter::Paint

While it's technically a breach of the StyleImage::CanRender() contract,
some StyleImage implementations still return nullptr from their
GetImage(). Since we check this at various other locations already, add
one here as well. This would only crash when tracing because the only
unchecked dereference is inside the TRACE_EVENT1 macro.

Bug: 1006872
Change-Id: Ie0de2eddc8e79aa5527b2eb5b762590fc7eadd11
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1824263Reviewed-by: default avatarStephen Chenney <schenney@chromium.org>
Commit-Queue: Fredrik Söderquist <fs@opera.com>
Cr-Commit-Position: refs/heads/master@{#699802}
parent 1fa8ecaf
......@@ -181,6 +181,8 @@ bool NinePieceImagePainter::Paint(GraphicsContext& graphics_context,
document, 1, border_image_rect.size.ToLayoutSize()));
scoped_refptr<Image> image =
style_image->GetImage(observer, document, style, FloatSize(image_size));
if (!image)
return true;
TRACE_EVENT1(TRACE_DISABLED_BY_DEFAULT("devtools.timeline"), "PaintImage",
"data",
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment