[Webkit-unassigned] [Bug 254410] New: [CG] Handle properly the case when an image does not have a valid output colorspace

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Mar 24 06:15:15 PDT 2023


https://bugs.webkit.org/show_bug.cgi?id=254410

            Bug ID: 254410
           Summary: [CG] Handle properly the case when an image does not
                    have a valid output colorspace
           Product: WebKit
           Version: WebKit Nightly Build
          Hardware: Unspecified
                OS: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: Images
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: sabouhallawa at apple.com
                CC: sabouhallawa at apple.com

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.

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20230324/00d5a02a/attachment-0001.htm>


More information about the webkit-unassigned mailing list