[Libreoffice-commits] core.git: Branch 'libreoffice-4-4' - vcl/opengl
Louis-Francis Ratté-Boulianne
lfrb at collabora.com
Mon Dec 15 04:35:34 PST 2014
vcl/opengl/texture.cxx | 8 ++++++++
1 file changed, 8 insertions(+)
New commits:
commit 4dd7f8e49449f73ef597025a773f524ef54cae12
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 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;
More information about the Libreoffice-commits
mailing list