[Libreoffice-commits] core.git: Branch 'libreoffice-5-2' - vcl/opengl

Tomaž Vajngerl tomaz.vajngerl at collabora.co.uk
Fri Dec 9 15:28:37 UTC 2016


 vcl/opengl/gdiimpl.cxx |    4 ++++
 1 file changed, 4 insertions(+)

New commits:
commit 210d0999a2b997566f3aeb183f50b2aa2788dbf3
Author: Tomaž Vajngerl <tomaz.vajngerl at collabora.co.uk>
Date:   Fri Dec 9 12:34:51 2016 +0100

    tdf#104034 skip polygons with less than 2 points (LO 5-2)
    
    We can get polypolgons with polygons that have 0 or 1 point only,
    so we need to guard agains division-by-zero errors by skipping if
    we detect such polygons (as we can't draw them anyway).
    
    Change-Id: I08c4f4c9bb946fcbaedede4b4ae23c96e431190e
    Reviewed-on: https://gerrit.libreoffice.org/31790
    Tested-by: Jenkins <ci at libreoffice.org>
    Reviewed-by: Michael Meeks <michael.meeks at collabora.com>

diff --git a/vcl/opengl/gdiimpl.cxx b/vcl/opengl/gdiimpl.cxx
index 34a8b51..c264c91 100644
--- a/vcl/opengl/gdiimpl.cxx
+++ b/vcl/opengl/gdiimpl.cxx
@@ -1899,6 +1899,8 @@ bool OpenGLSalGraphicsImpl::drawPolyPolygon( const basegfx::B2DPolyPolygon& rPol
         {
             for (const basegfx::B2DPolygon& rPolygon : rPolyPolygon)
             {
+                if (rPolygon.count() <= 1)
+                    continue;
                 basegfx::B2DPolygon aPolygon(rPolygon);
                 if (rPolygon.areControlPointsUsed())
                     aPolygon = rPolygon.getDefaultAdaptiveSubdivision();
@@ -1923,6 +1925,8 @@ bool OpenGLSalGraphicsImpl::drawPolyLine(
     VCL_GL_INFO( "::drawPolyLine trans " << fTransparency );
     if( mnLineColor == SALCOLOR_NONE )
         return true;
+    if (rPolygon.count() <= 1)
+        return true;
 
     const bool bIsHairline = (rLineWidth.getX() == rLineWidth.getY()) && (rLineWidth.getX() <= 1.2);
     const float fLineWidth = bIsHairline ? 1.0f : rLineWidth.getX();


More information about the Libreoffice-commits mailing list