Commit 372be1f8 authored by William Skaggs's avatar William Skaggs

Bill Skaggs <weskaggs@primate.ucdavis.edu>

	* app/core/gimpgradient-load.c: reject .ggr files whose
	segments don't properly span the range 0-1.
	Fixes bug #161430.
parent 3929204f
2004-12-16 Bill Skaggs <weskaggs@primate.ucdavis.edu>
* app/core/gimpgradient-load.c: reject .ggr files whose
segments don't properly span the range 0-1.
Fixes bug #161430.
2004-12-16 Manish Singh <yosh@gimp.org>
* app/widgets/gimppdbdialog.c (gimp_pdb_dialog_set_property): Cast
......
......@@ -171,11 +171,37 @@ gimp_gradient_load (const gchar *filename,
{
g_message (_("Corrupt segment %d in gradient file '%s'."),
i, gimp_filename_to_utf8 (filename));
g_object_unref (gradient);
fclose (file);
return NULL;
}
if ( (prev && (prev->right < seg->left))
|| (!prev && (0. < seg->left) ))
{
g_set_error (error, GIMP_DATA_ERROR, GIMP_DATA_ERROR_READ,
_("Gradient file '%s' is corrupt: "
"Segments do not span the range 0-1."),
gimp_filename_to_utf8 (filename));
g_object_unref (gradient);
fclose (file);
return NULL;
}
prev = seg;
}
if (prev->right < 1.0)
{
g_set_error (error, GIMP_DATA_ERROR, GIMP_DATA_ERROR_READ,
_("Gradient file '%s' is corrupt: "
"Segments do not span the range 0-1."),
gimp_filename_to_utf8 (filename));
g_object_unref (gradient);
fclose (file);
return NULL;
}
fclose (file);
return g_list_prepend (NULL, gradient);
......
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