summaryrefslogtreecommitdiff
path: root/drawinglayer
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-05-28 21:36:16 +0100
committerAndras Timar <andras.timar@collabora.com>2018-06-01 20:46:26 +0200
commit166fb85a421cc0de1331b5ba3f4e2a89bf631a07 (patch)
treeb47f15e4d5dc6bba690cb2d15521ee6a03310a3e /drawinglayer
parentfb8253f09342ae62a659c9528b3ea65bd3dec4dd (diff)
forcepoint#41 null deref
Change-Id: I16e9e083811c6e14861da1ba1df7d46e8c8771d7 Reviewed-on: https://gerrit.libreoffice.org/54974 Tested-by: Jenkins <ci@libreoffice.org> Reviewed-by: Christian Lohmaier <lohmaier+LibreOffice@googlemail.com> (cherry picked from commit 0a2035492c66bc323d84ad6c2c4cbc0dc3c9d9aa)
Diffstat (limited to 'drawinglayer')
-rw-r--r--drawinglayer/source/texture/texture3d.cxx11
1 files changed, 7 insertions, 4 deletions
diff --git a/drawinglayer/source/texture/texture3d.cxx b/drawinglayer/source/texture/texture3d.cxx
index 2120b8f04280..91604803f8eb 100644
--- a/drawinglayer/source/texture/texture3d.cxx
+++ b/drawinglayer/source/texture/texture3d.cxx
@@ -74,8 +74,6 @@ namespace drawinglayer
{
// #121194# Todo: use alpha channel, too (for 3d)
maBitmap = maBitmapEx.GetBitmap();
- mpReadBitmap = Bitmap::ScopedReadAccess(maBitmap);
- OSL_ENSURE(mpReadBitmap, "GeoTexSvxBitmapEx: Got no read access to Bitmap (!)");
if(mbIsTransparent)
{
@@ -92,8 +90,13 @@ namespace drawinglayer
mpReadTransparence = Bitmap::ScopedReadAccess(maTransparence);
}
- mfMulX = (double)mpReadBitmap->Width() / maSize.getX();
- mfMulY = (double)mpReadBitmap->Height() / maSize.getY();
+ mpReadBitmap = Bitmap::ScopedReadAccess(maBitmap);
+ SAL_WARN_IF(!mpReadBitmap, "drawinglayer", "GeoTexSvxBitmapEx: Got no read access to Bitmap");
+ if (mpReadBitmap)
+ {
+ mfMulX = static_cast<double>(mpReadBitmap->Width()) / maSize.getX();
+ mfMulY = static_cast<double>(mpReadBitmap->Height()) / maSize.getY();
+ }
if(maSize.getX() <= 1.0)
{