Kaydet (Commit) 4d379cd8 authored tarafından Michael Meeks's avatar Michael Meeks

tdf#97763 - avoid divide by zero for scaling images to tiny dimensions.

Change-Id: I27efebcc1c24d45c17da2ad2959b673153c3eead
Reviewed-on: https://gerrit.libreoffice.org/22297Reviewed-by: 's avatarMichael Meeks <michael.meeks@collabora.com>
Tested-by: 's avatarMichael Meeks <michael.meeks@collabora.com>
üst 07157e64
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment