summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2014-11-13 21:02:10 +0000
committerCaolán McNamara <caolanm@redhat.com>2014-11-13 21:13:41 +0000
commit06458fdeb862dc483dcac8107a5cc8c2da01a3f0 (patch)
tree3695fb0caf97b53cda8e0bde87ad1b174fcb3312 /vcl
parent0e066f4e2bf008e26e97dd861f66de0c3188ea06 (diff)
coverity#1251583 Division or modulo by zero
Change-Id: Ib3cb04305a39d652b188d8cff1d63f85074427a0
Diffstat (limited to 'vcl')
-rw-r--r--vcl/opengl/salbmp.cxx6
1 files changed, 3 insertions, 3 deletions
diff --git a/vcl/opengl/salbmp.cxx b/vcl/opengl/salbmp.cxx
index 686a7850b9bd..871b66960fe0 100644
--- a/vcl/opengl/salbmp.cxx
+++ b/vcl/opengl/salbmp.cxx
@@ -199,15 +199,15 @@ bool OpenGLSalBitmap::AllocateUserData()
}
bool alloc = false;
- if (mnBytesPerRow != 0
- && mnBytesPerRow <= std::numeric_limits<sal_uInt32>::max() / mnHeight)
+ if (mnBytesPerRow != 0 && mnHeight &&
+ mnBytesPerRow <= std::numeric_limits<sal_uInt32>::max() / mnHeight)
{
try
{
maUserBuffer.reset( new sal_uInt8[mnBytesPerRow * mnHeight] );
alloc = true;
}
- catch (std::bad_alloc &) {}
+ catch (const std::bad_alloc &) {}
}
if (!alloc)
{