summaryrefslogtreecommitdiffstats
path: root/src/gradient-chemistry.cpp
diff options
context:
space:
mode:
authorbulia byak <buliabyak@gmail.com>2008-03-26 06:04:04 +0000
committerbuliabyak <buliabyak@users.sourceforge.net>2008-03-26 06:04:04 +0000
commit0d06b0c57e28f85740e806b7e0d6477d74f2f5c0 (patch)
treedd2a5ae4243c497a5b03641137e546e3e812b4a2 /src/gradient-chemistry.cpp
parentsystem clipboard support (bug #170185) from Chris KosiƄski (diff)
downloadinkscape-0d06b0c57e28f85740e806b7e0d6477d74f2f5c0.tar.gz
inkscape-0d06b0c57e28f85740e806b7e0d6477d74f2f5c0.zip
fix crash caused by a gradient without a zero-offset stop
(bzr r5191)
Diffstat (limited to 'src/gradient-chemistry.cpp')
-rw-r--r--src/gradient-chemistry.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/gradient-chemistry.cpp b/src/gradient-chemistry.cpp
index 057877daf..303db8849 100644
--- a/src/gradient-chemistry.cpp
+++ b/src/gradient-chemistry.cpp
@@ -555,6 +555,12 @@ SPStop*
sp_get_stop_i(SPGradient *gradient, guint stop_i)
{
SPStop *stop = sp_first_stop (gradient);
+
+ // if this is valid but weird gradient without an offset-zero stop element,
+ // inkscape has created a handle for the start of gradient anyway,
+ // so when it asks for stop N that corresponds to stop element N-1
+ if (stop->offset != 0)
+ stop_i --;
for (guint i=0; i < stop_i; i++) {
if (!stop) return NULL;