https://bugs.webkit.org/show_bug.cgi?id=228186
Reviewed by Myles C. Maxfield.
Source/WebCore:
Add null check to resolve crash in FontCache::lastResortFallbackFont. Additionally, return early in BitmapImage::getHBITMAPOfSize
when the bits per pixel in the bitmap is of unexpected size, since that will cause a crash under this function. This can happen
if an event is being handled while already in the Windows paint handler.
* platform/graphics/win/FontCacheWin.cpp:
(WebCore::FontCache::lastResortFallbackFont):
* platform/graphics/win/GraphicsContextCGWin.cpp:
(WebCore::CGContextWithHDC):
* platform/graphics/win/ImageCGWin.cpp:
(WebCore::BitmapImage::getHBITMAPOfSize):
Source/WebKitLegacy/win:
Add null check for bitmapDC. Proceeding without a valid bitmapDC will cause a crash. When painting is being done while already in the Windows paint handler,
we can end up with a bitmapDC which is null.
* WebView.cpp:
(WebView::paintIntoBackingStore):
Canonical link: https://commits.webkit.org/240795@main
git-svn-id: https://svn.webkit.org/repository/webkit/trunk@281380 268f45cc-cd09-0410-ab3c-d52691b4dbfc