mirror of https://github.com/GNOME/gimp.git
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.
This commit is contained in:
parent
3929204f58
commit
372be1f83a
|
@ -1,3 +1,9 @@
|
|||
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);
|
||||
|
|
Loading…
Reference in New Issue