Bug 254410
Summary: | [CG] Handle properly the case when an image does not have a valid output colorspace | ||
---|---|---|---|
Product: | WebKit | Reporter: | Said Abou-Hallawa <sabouhallawa> |
Component: | Images | Assignee: | Said Abou-Hallawa <sabouhallawa> |
Status: | RESOLVED DUPLICATE | ||
Severity: | Normal | CC: | sabouhallawa, webkit-bug-importer |
Priority: | P2 | Keywords: | InRadar |
Version: | WebKit Nightly Build | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
See Also: | https://bugs.webkit.org/show_bug.cgi?id=229021 |
Said Abou-Hallawa
NativeImage::colorSpace() always creates DestinationColorSpace from the return of CGImageGetColorSpace() without checking its value which can be null. We need to check the image colorspace is CGColorSpaceSupportsOutput() before creating DestinationColorSpace. CGColorSpaceSupportsOutput() will return false for a null input.
We can make the return type of NativeImage::colorSpace() std::optional<DestinationColorSpace> and make it return std::nullopt if CGColorSpaceSupportsOutput() returns false. We should let the caller decide what to do when the image does not have a valid DestinationColorSpace.
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Said Abou-Hallawa
rdar://107103646
Said Abou-Hallawa
rdar://107103646
Said Abou-Hallawa
Pull request: https://github.com/WebKit/WebKit-security/pull/33
Said Abou-Hallawa
Pull request: https://github.com/WebKit/WebKit/pull/11928
Said Abou-Hallawa
This is already fixed by bug 254406.
*** This bug has been marked as a duplicate of bug 254406 ***