Date: prev next · Thread: first prev next last
2013 Archives by date, by thread · List index


Hi,

I have submitted a patch for review:

    https://gerrit.libreoffice.org/2139

To pull it, you can do:

    git pull ssh://gerrit.libreoffice.org:29418/core refs/changes/39/2139/1

filter: svg: optimizeGradientStops: fix STL assertion

Check that there is actually more than one element in maStops before
tweaking its first 2 elements (can be reproduced with fdo#60471 Tux.svg)

Change-Id: I7e6ffdf510bb590a9ea9e3782b30247b8fb46ed5
(cherry picked from commit 2f4bd9d44f8bc9e50cd4b1205fa53e0a15ce0954)
---
M filter/source/svg/svgreader.cxx
1 file changed, 5 insertions(+), 1 deletion(-)



diff --git a/filter/source/svg/svgreader.cxx b/filter/source/svg/svgreader.cxx
index c76f117..4d064c7 100644
--- a/filter/source/svg/svgreader.cxx
+++ b/filter/source/svg/svgreader.cxx
@@ -377,7 +377,7 @@
     bool hasGradientOpacity( const Gradient& rGradient )
     {
         return
-            !rGradient.maStops.empty() &&
+            (rGradient.maStops.size() > 1) &&
             (maGradientStopVector[
                  rGradient.maStops[0]].maStopColor.a != 1.0 ||
              maGradientStopVector[
@@ -417,6 +417,10 @@
         }
 
         rGradient.maStops = aNewStops;
+        if (rGradient.maStops.size() < 2)
+        {
+            return; // can't optimize further...
+        }
 
         // axial gradient, maybe?
         if( rGradient.meType == Gradient::LINEAR &&

-- 
To view, visit https://gerrit.libreoffice.org/2139
To unsubscribe, visit https://gerrit.libreoffice.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I7e6ffdf510bb590a9ea9e3782b30247b8fb46ed5
Gerrit-PatchSet: 1
Gerrit-Project: core
Gerrit-Branch: libreoffice-4-0
Gerrit-Owner: Michael Stahl <mstahl@redhat.com>

Context


Privacy Policy | Impressum (Legal Info) | Copyright information: Unless otherwise specified, all text and images on this website are licensed under the Creative Commons Attribution-Share Alike 3.0 License. This does not include the source code of LibreOffice, which is licensed under the Mozilla Public License (MPLv2). "LibreOffice" and "The Document Foundation" are registered trademarks of their corresponding registered owners or are in actual use as trademarks in one or more countries. Their respective logos and icons are also subject to international copyright laws. Use thereof is explained in our trademark policy.