diff options
author | Tomaž Vajngerl <tomaz.vajngerl@collabora.co.uk> | 2019-03-08 19:44:26 +0100 |
---|---|---|
committer | Tomaž Vajngerl <quikee@gmail.com> | 2019-03-08 21:50:26 +0100 |
commit | 8de89e1c39b211cb4c39e47c992b03ed33003658 (patch) | |
tree | c33dbb43617f50ef36328f874234fbf8964b7d41 /vcl/source | |
parent | ba0abd02df8d62342497018f516535a2f1597fb6 (diff) |
Fix crash in widget drawing of a SVG as image
Change-Id: Iaa7e01b49b9c2dcdfa98e4e8bc431dba82fe6bb4
Reviewed-on: https://gerrit.libreoffice.org/68942
Tested-by: Jenkins
Reviewed-by: Tomaž Vajngerl <quikee@gmail.com>
Diffstat (limited to 'vcl/source')
-rw-r--r-- | vcl/source/gdi/FileDefinitionWidgetDraw.cxx | 17 |
1 files changed, 15 insertions, 2 deletions
diff --git a/vcl/source/gdi/FileDefinitionWidgetDraw.cxx b/vcl/source/gdi/FileDefinitionWidgetDraw.cxx index 606417ac1ca5..abd55fb0bca0 100644 --- a/vcl/source/gdi/FileDefinitionWidgetDraw.cxx +++ b/vcl/source/gdi/FileDefinitionWidgetDraw.cxx @@ -329,8 +329,21 @@ void munchDrawCommands(std::vector<std::shared_ptr<DrawCommand>> const& rDrawCom long nImageWidth = aBitmap.GetSizePixel().Width(); long nImageHeight = aBitmap.GetSizePixel().Height(); SalTwoRect aTR(0, 0, nImageWidth, nImageHeight, nX, nY, nImageWidth, nImageHeight); - rGraphics.DrawBitmap(aTR, *aBitmap.GetBitmap().ImplGetSalBitmap().get(), - *aBitmap.GetAlpha().ImplGetSalBitmap().get(), nullptr); + if (!!aBitmap) + { + const std::shared_ptr<SalBitmap> pSalBitmap + = aBitmap.GetBitmap().ImplGetSalBitmap(); + if (aBitmap.IsAlpha()) + { + const std::shared_ptr<SalBitmap> pSalBitmapAlpha + = aBitmap.GetAlpha().ImplGetSalBitmap(); + rGraphics.DrawBitmap(aTR, *pSalBitmap, *pSalBitmapAlpha, nullptr); + } + else + { + rGraphics.DrawBitmap(aTR, *pSalBitmap, nullptr); + } + } } break; case DrawCommandType::EXTERNAL: |