[Libreoffice-commits] core.git: Branch 'feature/opengl-vcl2' - vcl/opengl
Louis-Francis Ratté-Boulianne
lfrb at collabora.com
Mon Nov 17 21:14:22 PST 2014
vcl/opengl/texture.cxx | 8 ++++++++
1 file changed, 8 insertions(+)
New commits:
commit 2195500d40055a182c573da074e61ddf0a2b4d5a
Author: Louis-Francis Ratté-Boulianne <lfrb at 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 938de54..5afb611 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;
More information about the Libreoffice-commits
mailing list