diff options
author | Louis-Francis Ratté-Boulianne <lfrb@collabora.com> | 2014-11-18 00:13:30 -0500 |
---|---|---|
committer | Louis-Francis Ratté-Boulianne <lfrb@collabora.com> | 2014-11-18 00:13:36 -0500 |
commit | 2195500d40055a182c573da074e61ddf0a2b4d5a (patch) | |
tree | 9b74f463273d9aabf7544f013ed99d943b943e84 | |
parent | 053b01fa6533ccd62b1bd184f0c7f9e42422cb8c (diff) |
vcl: Fix crash when requesting coordonnates for empty texture
Change-Id: I424ac73f23bed5b3782c148d9242ca8fc29d200d
-rw-r--r-- | vcl/opengl/texture.cxx | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/vcl/opengl/texture.cxx b/vcl/opengl/texture.cxx index 938de5428374..5afb6118a527 100644 --- a/vcl/opengl/texture.cxx +++ b/vcl/opengl/texture.cxx @@ -173,6 +173,14 @@ int OpenGLTexture::GetHeight() const void OpenGLTexture::GetCoord( GLfloat* pCoord, const SalTwoRect& rPosAry, bool bInverted ) const { SAL_INFO( "vcl.opengl", "Getting coord " << Id() << " [" << maRect.Left() << "," << maRect.Top() << "] " << GetWidth() << "x" << GetHeight() ); + + if( mpImpl == NULL ) + { + pCoord[0] = pCoord[1] = pCoord[2] = pCoord[3] = 0.0f; + pCoord[4] = pCoord[5] = pCoord[6] = pCoord[7] = 0.0f; + return; + } + pCoord[0] = pCoord[2] = (maRect.Left() + rPosAry.mnSrcX) / (double) mpImpl->mnWidth; pCoord[4] = pCoord[6] = (maRect.Left() + rPosAry.mnSrcX + rPosAry.mnSrcWidth) / (double) mpImpl->mnWidth; |