(svg_parser_end_element): don't crash on empty gradient definitions.

This commit is contained in:
Sven Neumann 2004-07-23 12:55:58 +00:00
parent df0bf0185b
commit f0da0e438c
2 changed files with 3 additions and 1 deletions

View File

@ -2,6 +2,7 @@
* app/core/gimpgradient-load.c (gimp_gradient_load_svg): improved
error message.
(svg_parser_end_element): don't crash on empty gradient definitions.
2004-07-23 Sven Neumann <sven@gimp.org>

View File

@ -364,7 +364,8 @@ svg_parser_end_element (GMarkupParseContext *context,
{
parser->state = SVG_STATE_OUT;
}
else if (parser->gradient && strcmp (element_name, "linearGradient") == 0)
else if (parser->gradient && parser->stops &&
strcmp (element_name, "linearGradient") == 0)
{
GimpGradientSegment *seg = gimp_gradient_segment_new ();
GimpGradientSegment *next = NULL;