summaryrefslogtreecommitdiff
path: root/vcl
diff options
context:
space:
mode:
authorMichael Meeks <michael.meeks@collabora.com>2016-02-11 17:35:20 +0000
committerMichael Meeks <michael.meeks@collabora.com>2016-02-11 18:01:36 +0000
commit4d379cd842a9d27a0aec54af5b2ce94c01dfa0bd (patch)
tree0165bce467387f74e925381aef6afa45a8242994 /vcl
parent07157e644fa9666850767ff6bd54c1511167a0a2 (diff)
tdf#97763 - avoid divide by zero for scaling images to tiny dimensions.
Change-Id: I27efebcc1c24d45c17da2ad2959b673153c3eead Reviewed-on: https://gerrit.libreoffice.org/22297 Reviewed-by: Michael Meeks <michael.meeks@collabora.com> Tested-by: Michael Meeks <michael.meeks@collabora.com>
Diffstat (limited to 'vcl')
-rw-r--r--vcl/opengl/gdiimpl.cxx4
1 files changed, 4 insertions, 0 deletions
diff --git a/vcl/opengl/gdiimpl.cxx b/vcl/opengl/gdiimpl.cxx
index 6676baf040cb..6828efb9b49d 100644
--- a/vcl/opengl/gdiimpl.cxx
+++ b/vcl/opengl/gdiimpl.cxx
@@ -1072,6 +1072,10 @@ void OpenGLSalGraphicsImpl::DrawTransformedTexture(
const long nDestWidth = basegfx::fround(basegfx::B2DVector(rX - rNull).getLength());
const long nDestHeight = basegfx::fround(basegfx::B2DVector(rY - rNull).getLength());
+ // Invisibly small images shouldn't divide by zero.
+ if( nDestHeight == 0 || nDestWidth == 0 )
+ return;
+
const double ixscale = rTexture.GetWidth() / nDestWidth;
const double iyscale = rTexture.GetHeight() / nDestHeight;