Kaydet (Commit) 2f4bd9d4 authored tarafından Michael Stahl's avatar Michael Stahl

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
üst 4db5b17c
......@@ -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 &&
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment