Skip to content

Commit

Permalink
Null deref under DynamicContentScalingImageBufferBackend::createBacke…
Browse files Browse the repository at this point in the history
…ndHandle

https://bugs.webkit.org/show_bug.cgi?id=266723
rdar://119854411

Reviewed by Aditya Keerthi.

* Source/WebKit/Shared/RemoteLayerTree/DynamicContentScalingImageBufferBackend.mm:
(WebKit::DynamicContentScalingImageBufferBackend::createBackendHandle const):
Add a null check, since we have evidence that we can be asked to make a backend
handle when nobody has painted into the layer. I'm not sure why, but it's certainly
preferable to just not have a display list than to crash.

Canonical link: https://commits.webkit.org/272380@main
  • Loading branch information
hortont424 committed Dec 20, 2023
1 parent 15862a5 commit 35b5d99
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,8 @@ static CFDictionaryRef makeContextOptions(const DynamicContentScalingImageBuffer

std::optional<ImageBufferBackendHandle> DynamicContentScalingImageBufferBackend::createBackendHandle(SharedMemory::Protection) const
{
ASSERT(m_context);
if (!m_context)
return std::nullopt;

RetainPtr<NSDictionary> options;
RetainPtr<NSMutableArray> ports;
Expand Down

0 comments on commit 35b5d99

Please sign in to comment.