diff options
author | Michael Stahl <mstahl@redhat.com> | 2013-02-13 15:42:37 +0100 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2013-02-13 16:31:56 +0100 |
commit | 2f4bd9d44f8bc9e50cd4b1205fa53e0a15ce0954 (patch) | |
tree | dd4643591f6b24c10a60f9652143a703a8db4f80 /filter/source | |
parent | 4db5b17c78c3a6567abfcd3cb43a46c1c4c80cf4 (diff) |
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
Diffstat (limited to 'filter/source')
-rw-r--r-- | filter/source/svg/svgreader.cxx | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/filter/source/svg/svgreader.cxx b/filter/source/svg/svgreader.cxx index 5e9e994de348..5aedf0d7b05b 100644 --- a/filter/source/svg/svgreader.cxx +++ b/filter/source/svg/svgreader.cxx @@ -327,7 +327,7 @@ struct AnnotatingVisitor bool hasGradientOpacity( const Gradient& rGradient ) { return - !rGradient.maStops.empty() && + (rGradient.maStops.size() > 1) && (maGradientStopVector[ rGradient.maStops[0]].maStopColor.a != 1.0 || maGradientStopVector[ @@ -367,6 +367,10 @@ struct AnnotatingVisitor } rGradient.maStops = aNewStops; + if (rGradient.maStops.size() < 2) + { + return; // can't optimize further... + } // axial gradient, maybe? if( rGradient.meType == Gradient::LINEAR && |