summaryrefslogtreecommitdiff
path: root/vcl/unx
diff options
context:
space:
mode:
authorKatarina Behrens <Katarina.Behrens@cib.de>2018-09-05 15:21:08 +0200
committerThorsten Behrens <Thorsten.Behrens@CIB.de>2018-09-05 19:50:58 +0200
commit42b3be24f058ce470db54232cc496d56e2fd774e (patch)
tree587d80381e9c19152d3197f9f4d6f609990c92df /vcl/unx
parentde2c99f715aeac78ee310200b49006a56cdc8d17 (diff)
Avoid crash in printer dlg due to empty QImage
Crash seems to be limited to vertical FixedLine control type. This is just a band-aid, need to find out what's wrong with drawing this specific control. Other control don't seem to be affected Change-Id: Ie04bc04bbdf95920d62d43ac7874e7dba1441a4c Reviewed-on: https://gerrit.libreoffice.org/60039 Tested-by: Jenkins Reviewed-by: Thorsten Behrens <Thorsten.Behrens@CIB.de>
Diffstat (limited to 'vcl/unx')
-rw-r--r--vcl/unx/kde5/KDE5SalGraphics.cxx13
1 files changed, 8 insertions, 5 deletions
diff --git a/vcl/unx/kde5/KDE5SalGraphics.cxx b/vcl/unx/kde5/KDE5SalGraphics.cxx
index 9f177556915b..583edf6e8e6c 100644
--- a/vcl/unx/kde5/KDE5SalGraphics.cxx
+++ b/vcl/unx/kde5/KDE5SalGraphics.cxx
@@ -25,11 +25,14 @@
static void QImage2BitmapBuffer(QImage* pImg, BitmapBuffer* pBuf)
{
- pBuf->mnWidth = pImg->width();
- pBuf->mnHeight = pImg->height();
- pBuf->mnBitCount = getFormatBits(pImg->format());
- pBuf->mpBits = pImg->bits();
- pBuf->mnScanlineSize = pImg->bytesPerLine();
+ if (pImg->width() != 0 && pImg->height() != 0)
+ {
+ pBuf->mnWidth = pImg->width();
+ pBuf->mnHeight = pImg->height();
+ pBuf->mnBitCount = getFormatBits(pImg->format());
+ pBuf->mpBits = pImg->bits();
+ pBuf->mnScanlineSize = pImg->bytesPerLine();
+ }
}
KDE5SalGraphics::KDE5SalGraphics()