Add a missing null check to ShareableBitmap::makeCGImageCopy()
https://bugs.webkit.org/show_bug.cgi?id=200184
Summary Add a missing null check to ShareableBitmap::makeCGImageCopy()
Ryosuke Niwa
Reported 2019-07-26 16:45:25 PDT
ShareableBitmap::makeCGImageCopy() should have a null check for when createGraphicsContext() could return a nil.
Attachments
Fixes the bug (2.30 KB, patch)
2019-07-26 17:13 PDT, Ryosuke Niwa
simon.fraser: review-
Patch for landing (2.83 KB, patch)
2019-07-26 17:31 PDT, Ryosuke Niwa
simon.fraser: review+
Ryosuke Niwa
Comment 1 2019-07-26 16:45:48 PDT
Ryosuke Niwa
Comment 2 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.
Ryosuke Niwa
Comment 3 2019-07-26 17:13:39 PDT
Created attachment 375002 [details] Fixes the bug
Simon Fraser (smfr)
Comment 4 2019-07-26 17:26:41 PDT
Comment on attachment 375002 [details] Fixes the bug What about convertCGImageToBitmap()?
Ryosuke Niwa
Comment 5 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.
Ryosuke Niwa
Comment 6 2019-07-26 17:31:07 PDT
Created attachment 375004 [details] Patch for landing
Simon Fraser (smfr)
Comment 7 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.
Simon Fraser (smfr)
Comment 8 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.
Ryosuke Niwa
Comment 9 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
Note You need to log in before you can comment on or make changes to this bug.