diff options
author | Luboš Luňák <l.lunak@collabora.com> | 2020-09-29 09:52:05 +0200 |
---|---|---|
committer | Luboš Luňák <l.lunak@collabora.com> | 2020-09-29 10:33:42 +0200 |
commit | 1cd7e2a4042b92123d8c94ef10b2e8baf7cfaafa (patch) | |
tree | 5a398d4fcdb94cdb76bd71436ebda490c8b0c608 /vcl | |
parent | 614d310751d1a32baec85c11637fb3813a9dd749 (diff) |
avoid crash if DrawTransformedBitmap() would mean empty Skia bitmap
I can reproduce this sometimes with the document from tdf#136223.
Change-Id: Ie6e57f18936a5de7f99ab01932be229625b737c1
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/103596
Tested-by: Jenkins
Reviewed-by: Luboš Luňák <l.lunak@collabora.com>
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/skia/gdiimpl.cxx | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/vcl/skia/gdiimpl.cxx b/vcl/skia/gdiimpl.cxx index 0fff8776fe8f..ade34a6e8b01 100644 --- a/vcl/skia/gdiimpl.cxx +++ b/vcl/skia/gdiimpl.cxx @@ -1484,6 +1484,8 @@ sk_sp<SkImage> SkiaSalGraphicsImpl::mergeCacheBitmaps(const SkiaSalBitmap& bitma // GPU-accelerated drawing with SkShader should be fast enough to not need caching. if (isGPU()) return image; + if (targetSize.IsEmpty()) + return image; if (alphaBitmap && alphaBitmap->IsFullyOpaqueAsAlpha()) alphaBitmap = nullptr; // the alpha can be ignored // Probably not much point in caching of just doing a copy. |