Do not crash when loading corrupt gradient files. Ensure that error

2006-08-05  Raphael Quinet  <raphael@gimp.org>

	* app/core/gimpgradient-load.c (gimp_gradient_load): Do not crash
	when loading corrupt gradient files.  Ensure that error messages
	are correctly reported with g_set_error() instead of g_message().
	Fixes bug #349996.
This commit is contained in:
Raphael Quinet 2006-08-04 23:53:28 +00:00 committed by Raphaël Quinet
parent 7c245e1654
commit 5ce64ce234
2 changed files with 8 additions and 2 deletions

View File

@ -1,5 +1,10 @@
2006-08-05 Raphaël Quinet <raphael@gimp.org>
* app/core/gimpgradient-load.c (gimp_gradient_load): Do not crash
when loading corrupt gradient files. Ensure that error messages
are correctly reported with g_set_error() instead of g_message().
Fixes bug #349996.
* plug-ins/imagemap/imap_ncsa.l: Do not declare a symbol "link"
because this conflicts with the system call declared in
<unistd.h>. Renamed that symbol "imap_link". Fixes bug #349589.

View File

@ -159,8 +159,9 @@ gimp_gradient_load (const gchar *filename,
}
else
{
g_message (_("Corrupt segment %d in gradient file '%s'."),
i, gimp_filename_to_utf8 (filename));
g_set_error (error, GIMP_DATA_ERROR, GIMP_DATA_ERROR_READ,
_("Corrupt segment %d in gradient file '%s'."),
i, gimp_filename_to_utf8 (filename));
g_object_unref (gradient);
fclose (file);
return NULL;