From 5ce64ce234c95d027b37b8df0621dd02ecb76a59 Mon Sep 17 00:00:00 2001 From: Raphael Quinet Date: Fri, 4 Aug 2006 23:53:28 +0000 Subject: [PATCH] Do not crash when loading corrupt gradient files. Ensure that error 2006-08-05 Raphael Quinet * 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. --- ChangeLog | 5 +++++ app/core/gimpgradient-load.c | 5 +++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/ChangeLog b/ChangeLog index f2cc8169a3..12c905984f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2006-08-05 Raphaƫl Quinet + * 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 . Renamed that symbol "imap_link". Fixes bug #349589. diff --git a/app/core/gimpgradient-load.c b/app/core/gimpgradient-load.c index 9bffcaa3e1..973dd00d3d 100644 --- a/app/core/gimpgradient-load.c +++ b/app/core/gimpgradient-load.c @@ -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;