mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Don't crash when CurrentSurface() or GetDC() return null. b=391243 r+sr+a=vladimir
This commit is contained in:
parent
bbe0108c14
commit
c366407693
@ -80,11 +80,14 @@ static PRLogModuleInfo *gFontLog = PR_NewLogModule("winfonts");
|
||||
|
||||
struct DCFromContext {
|
||||
DCFromContext(gfxContext *aContext) {
|
||||
HDC dc = NULL;
|
||||
nsRefPtr<gfxASurface> aSurface = aContext->CurrentSurface();
|
||||
if (aSurface->GetType() == gfxASurface::SurfaceTypeWin32) {
|
||||
NS_ASSERTION(aSurface, "DCFromContext: null surface");
|
||||
if (aSurface && aSurface->GetType() == gfxASurface::SurfaceTypeWin32) {
|
||||
dc = static_cast<gfxWindowsSurface*>(aSurface.get())->GetDC();
|
||||
needsRelease = PR_FALSE;
|
||||
} else {
|
||||
}
|
||||
if (!dc) {
|
||||
dc = GetDC(NULL);
|
||||
needsRelease = PR_TRUE;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user