summaryrefslogtreecommitdiff
path: root/drawinglayer
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2018-05-28 21:36:16 +0100
committerCaolán McNamara <caolanm@redhat.com>2018-05-29 10:08:13 +0200
commitf532decefb7881eb5f56864db9fcfd5d2ba85ee4 (patch)
tree3e67f04ba266f7aeecd49459b0bf2c6449327dd3 /drawinglayer
parent9f1fb000a50f38e45b68b4cb14cb4f7f9c514f82 (diff)
forcepoint#41 null deref
Change-Id: I16e9e083811c6e14861da1ba1df7d46e8c8771d7 Reviewed-on: https://gerrit.libreoffice.org/54973 Reviewed-by: Caolán McNamara <caolanm@redhat.com> Tested-by: Caolán McNamara <caolanm@redhat.com>
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 fc8750199c8f..0dac447ccf50 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 = static_cast<double>(mpReadBitmap->Width()) / maSize.getX();
- mfMulY = static_cast<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)
{