diff options
author | Caolán McNamara <caolanm@redhat.com> | 2014-11-13 21:02:10 +0000 |
---|---|---|
committer | Caolán McNamara <caolanm@redhat.com> | 2014-11-13 21:13:41 +0000 |
commit | 06458fdeb862dc483dcac8107a5cc8c2da01a3f0 (patch) | |
tree | 3695fb0caf97b53cda8e0bde87ad1b174fcb3312 /vcl | |
parent | 0e066f4e2bf008e26e97dd861f66de0c3188ea06 (diff) |
coverity#1251583 Division or modulo by zero
Change-Id: Ib3cb04305a39d652b188d8cff1d63f85074427a0
Diffstat (limited to 'vcl')
-rw-r--r-- | vcl/opengl/salbmp.cxx | 6 |
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) { |