GNOME Bugzilla – Bug 349996
Segmentation fault with malformed gradient files
Last modified: 2008-01-15 14:07:52 UTC
From Debian bug report http://bugs.debian.org/381440: I accidentally created an invalid gradient file (last field of each segment missing) while writing a Perl script to reverse gradients. GIMP's last words were: GIMP: Corrupt segment 0 in gradient file '/home/michael/.gimp-2.2/gradients/Sea-and-Land-old-reversed.ggr'. I am not convinced that malformed input is justification for a SEGV. :P Here is the backtrace:
+ Trace 69988
Created attachment 70231 [details] gradient file that crashes the gimp
The error is correctly detected, but not correctly reported. This line: g_message (_("Failed to load data:\n\n%s"), error->message); causes a crash because error is NULL. This happens because the load_func fails and returns NULL but does not set the error variable before returning: data_list = factory->loader_entries[i].load_func (file_data->filename, &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.
Also backported to the stable branch gimp-2-2.
Setting milestone 2.2 to make it show up in the fixed bugs.