Bug 200184 - Add a missing null check to ShareableBitmap::makeCGImageCopy()
Summary: Add a missing null check to ShareableBitmap::makeCGImageCopy()
Status: NEW
Alias: None
Product: WebKit
Classification: Unclassified
Component: Images (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Ryosuke Niwa
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2019-07-26 16:45 PDT by Ryosuke Niwa
Modified: 2022-07-24 11:34 PDT (History)
7 users (show)

See Also:


Attachments
Fixes the bug (2.30 KB, patch)
2019-07-26 17:13 PDT, Ryosuke Niwa
simon.fraser: review-
Details | Formatted Diff | Diff
Patch for landing (2.83 KB, patch)
2019-07-26 17:31 PDT, Ryosuke Niwa
simon.fraser: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Ryosuke Niwa 2019-07-26 16:45:25 PDT
ShareableBitmap::makeCGImageCopy() should have a null check for when createGraphicsContext() could return a nil.
Comment 1 Ryosuke Niwa 2019-07-26 16:45:48 PDT
<rdar://problem/53572444>
Comment 2 Ryosuke Niwa 2019-07-26 17:10:28 PDT
It's also possible that m_data of GraphicsContext to be null. Tracking this issue in the bug 200185.
Comment 3 Ryosuke Niwa 2019-07-26 17:13:39 PDT
Created attachment 375002 [details]
Fixes the bug
Comment 4 Simon Fraser (smfr) 2019-07-26 17:26:41 PDT
Comment on attachment 375002 [details]
Fixes the bug

What about convertCGImageToBitmap()?
Comment 5 Ryosuke Niwa 2019-07-26 17:30:02 PDT
(In reply to Simon Fraser (smfr) from comment #4)
> Comment on attachment 375002 [details]
> Fixes the bug
> 
> What about convertCGImageToBitmap()?

Sure, I'll add the check there too.
Comment 6 Ryosuke Niwa 2019-07-26 17:31:07 PDT
Created attachment 375004 [details]
Patch for landing
Comment 7 Simon Fraser (smfr) 2019-07-26 17:31:50 PDT
Comment on attachment 375002 [details]
Fixes the bug

I think you should make ShareableBitmap::createGraphicsContext() return nullptr and fix the ~10 call sites that we care about.
Comment 8 Simon Fraser (smfr) 2019-07-26 17:32:24 PDT
Comment on attachment 375004 [details]
Patch for landing

I think you should make ShareableBitmap::createGraphicsContext() return nullptr and fix the ~10 call sites that we care about.
Comment 9 Ryosuke Niwa 2019-07-26 20:10:02 PDT
(In reply to Simon Fraser (smfr) from comment #8)
> Comment on attachment 375004 [details]
> Patch for landing
> 
> I think you should make ShareableBitmap::createGraphicsContext() return
> nullptr and fix the ~10 call sites that we care about.

That's done in https://bugs.webkit.org/show_bug.cgi?id=200185