avoid Skia xor crash with not-yet-drawn surface (tdf#132335)
No content yet, nothing to xor with.
Change-Id: I68b44d6051859a61d50c5fbf8e3c63e719a87ca3
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/92753
Tested-by: Jenkins
Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
diff --git a/vcl/skia/gdiimpl.cxx b/vcl/skia/gdiimpl.cxx
index 6926823..2ed26e7 100644
--- a/vcl/skia/gdiimpl.cxx
+++ b/vcl/skia/gdiimpl.cxx
@@ -505,8 +505,9 @@
// in each operation by extending mXorRegion with the area that should be
// updated.
assert(mXorMode);
if (!mXorRegion.op(SkIRect::MakeXYWH(0, 0, mSurface->width(), mSurface->height()),
SkRegion::kIntersect_Op))
if (!mSurface
|| !mXorRegion.op(SkIRect::MakeXYWH(0, 0, mSurface->width(), mSurface->height()),
SkRegion::kIntersect_Op))
{
mXorRegion.setEmpty();
return;