vcl/opengl/texture.cxx | 8 ++++++++ 1 file changed, 8 insertions(+) New commits: commit 214ba32cd4d20691c8ba16b94a7ae621575839f4 Author: Louis-Francis Ratté-Boulianne <l...@collabora.com> Date: Tue Nov 18 00:13:30 2014 -0500
vcl: Fix crash when requesting coordonnates for empty texture Change-Id: I424ac73f23bed5b3782c148d9242ca8fc29d200d diff --git a/vcl/opengl/texture.cxx b/vcl/opengl/texture.cxx index e4bc532..d727d8b 100644 --- a/vcl/opengl/texture.cxx +++ b/vcl/opengl/texture.cxx @@ -186,6 +186,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;
_______________________________________________ Libreoffice-commits mailing list libreoffice-comm...@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/libreoffice-commits