summaryrefslogtreecommitdiff
path: root/vcl/opengl
diff options
context:
space:
mode:
authorCaolán McNamara <caolanm@redhat.com>2015-01-31 19:06:52 +0000
committerCaolán McNamara <caolanm@redhat.com>2015-01-31 19:06:55 +0000
commitfed1ed0a17a770e9b4c75ef4737032f9ad2e154a (patch)
tree2866f7c7fc03d02aba53d9b19184b139be6c970d /vcl/opengl
parent1fb386749d9f9c599a08edcaef7848c82c95a38f (diff)
coverity#1267670 Division or modulo by float zero
and coverity#1267699 Division or modulo by float zero Change-Id: If31037712208673438155b30369ebe1068387cba
Diffstat (limited to 'vcl/opengl')
-rw-r--r--vcl/opengl/gdiimpl.cxx12
1 files changed, 5 insertions, 7 deletions
diff --git a/vcl/opengl/gdiimpl.cxx b/vcl/opengl/gdiimpl.cxx
index 854c09035ca3..dcede20838ee 100644
--- a/vcl/opengl/gdiimpl.cxx
+++ b/vcl/opengl/gdiimpl.cxx
@@ -934,23 +934,21 @@ void OpenGLSalGraphicsImpl::DrawTransformedTexture(
return;
}
- if( areaScaling )
+ int mnWidth = rTexture.GetWidth();
+ int mnHeight = rTexture.GetHeight();
+ if(areaScaling )
{
// From OpenGLSalBitmap::ImplScaleArea().
- if( fastAreaScaling )
+ if (fastAreaScaling && mnWidth && mnHeight)
{
- int mnWidth = rTexture.GetWidth();
- int mnHeight = rTexture.GetHeight();
mpProgram->SetUniform1i( "xscale", ixscale );
mpProgram->SetUniform1i( "yscale", iyscale );
mpProgram->SetUniform1f( "xstep", 1.0 / mnWidth );
mpProgram->SetUniform1f( "ystep", 1.0 / mnHeight );
mpProgram->SetUniform1f( "ratio", 1.0 / ( ixscale * iyscale ));
}
- else
+ else if (mnHeight > 1 && mnWidth > 1)
{
- int mnWidth = rTexture.GetWidth();
- int mnHeight = rTexture.GetHeight();
mpProgram->SetUniform1f( "xscale", ixscale );
mpProgram->SetUniform1f( "yscale", iyscale );
mpProgram->SetUniform1i( "swidth", mnWidth );