Conditional jump or move depends on uninitialised value(s)
==28817== at 0x6AA386: gimp_coords_manhattan_dist (gimp/app/core/gimpcoords.c:175)
==28817== by 0x6AB428: gimp_coords_bezier_is_straight (gimp/app/core/gimpcoords-interpolate.c:213)
==28817== by 0x67663B: gimp_bezier_stroke_segment_nearest_point_get (gimp/app/vectors/gimpbezierstroke.c:676)
==28817== by 0x676C86: gimp_bezier_stroke_nearest_point_get (gimp/app/vectors/gimpbezierstroke.c:631)
==28817== by 0x4D79E3: gimp_draw_tool_on_vectors_curve (gimp/app/tools/gimpdrawtool.c:1175)
==28817== by 0x4D7CD5: gimp_draw_tool_on_vectors (gimp/app/tools/gimpdrawtool.c:1242)
==28817== by 0x511CE7: gimp_vector_tool_oper_update (gimp/app/tools/gimpvectortool.c:989)
==28817== by 0x50B059: gimp_tool_oper_update (gimp/app/tools/gimptool.c:970)
==28817== by 0x546F3C: gimp_display_shell_canvas_tool_events (gimp/app/display/gimpdisplayshell-tool-events.c:401)
==28817== by 0x52A42E2: _gtk_marshal_BOOLEAN__BOXED (gtk-2-24/gtk/gtkmarshalers.c:86)
Steps to reproduce:
G_SLICE=always-malloc valgrind gimp-2.7 app/tests/*/*.xcf
B (Activate Path tool)
Introduced two virtual functions to a GimpViewable
'set_expanded' and 'get_expanded'
and a PROP_GROUP_ITEM_FLAGS to load/save the expanded state
of layer_groups and use them.
and get rid of the brainfuck idea that app/ has to use _gimp_unit_foo()
functions, passing a gimp pointer. Instead, simply use the libgimpbase
API all over the place. Should we ever allow more than one gimp instance,
they will simply have to share one unit database.
Don't add layer masks to their layers while loading because a newly
loaded group layer's size doesn't match its mask's size. Instead,
attach all layer masks to their layers using g_object_set_data(), and
add them after all layers have been loaded.
A floating selection is always the first layer in the image, but on
XCF loading it is attached *after* all layers are loaded, so the item
paths for child layers read from the XCF are off-by-one in their
toplevel index. Adjust them so everything loads as it should.
* app/xcf/xcf-private.h: add properties PROP_GROUP_ITEM and
PROP_ITEM_PATH
* app/xcf/xcf-save.c: when saving a group layer, save a
PROP_GROUP_ITEM. When saving a child item, save a PROP_ITEM_PATH
which contains the path indices returned by gimp_item_get_path().
* app/xcf/xcf-load.c: when loading a PROP_GROUP_ITEM, replace the
layer that is being loaded by a GimpGroupLayer, also ignore that
layer's hierarchy (it makes no sense to load the tiles of a layer
that's generated from its children). When loading a PROP_ITEM_PATH,
pass the loaded path up to xcf_load_image() so it can add the loaded
layer at the right place in the tree.
As when loading channel props (which can replace the GimpChannel by a
GimpSelection), pass a GimpLayer** instead of a GimpLayer* to
xcf_load_layer_props(), so the function can replace the GimpLayer to
load by another type (e.g. GimpGroupLayer).
Add XCF property PROP_LOCK_CONTENT and save/load it for all layers and
channels. Vectors saving needs some refactoring here I'm afraid, so I
ignored it for now.
* app/core/gimpimage.[ch]: make the parent parameter public in
add_layer(), add_layers(), add_channel() and add_vectors().
* app/vectors/gimpvectors-import.[ch]: add parent parameters to
the vectors import functions.
* app/core/gimpchannelundo.[ch]
* app/core/gimplayerundo.[ch]
* app/vectors/gimpvectorsundo.[ch]
* app/core/gimpimage-undo-push.[ch]: remember the parent item when
removing layers, channels and vectors.
* app/actions/channels-commands.c
* app/actions/debug-commands.c
* app/actions/edit-commands.c
* app/actions/layers-commands.c
* app/actions/vectors-commands.c
* app/core/gimp-edit.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage-merge.c
* app/core/gimpimage-quick-mask.c
* app/core/gimplayer-floating-sel.c
* app/core/gimpselection.c
* app/core/gimptemplate.c
* app/dialogs/file-open-dialog.c
* app/display/gimpdisplayshell-dnd.c
* app/text/gimptext-compat.c
* app/tools/gimptexttool.c
* app/tools/gimpvectortool.c
* app/widgets/gimptoolbox-dnd.c
* app/xcf/xcf-load.c
* tools/pdbgen/pdb/image.pdb
* tools/pdbgen/pdb/paths.pdb
* tools/pdbgen/pdb/vectors.pdb: pass NULL as parent item to above
functions and add FIXMEs all over the place because there is some
more hacking needed to make adding with index = -1 (on top of the
current item) work again.
* app/pdb/image-cmds.c
* app/pdb/paths-cmds.c
* app/pdb/vectors-cmds.c: regenerated.
* app/core/gimpimage-duplicate.c: duplicate the original image's
tree structure in the copy.
* app/widgets/gimpitemtreeview.[ch]: add parent to GimpAddItemFunc,
add utility function gimp_item_tree_view_get_drop_index() which
figures where to add something dropped to an item tree.
* app/widgets/gimpchanneltreeview.c
* app/widgets/gimplayertreeview.c
* app/widgets/gimpvectorstreeview.c: changed accordingly, using above
new GimpItemTreeView API.
2009-02-04 Michael Natterer <mitch@gimp.org>
* app/core/Makefile.am
* app/core/gimpdrawable-private.h: new file which contains struct
GimpDrawablePrivate. Move some stuff from GimpDrawable here.
* app/core/gimpdrawable.[ch]
* app/core/gimpdrawable-shadow.c: changed accordingly.
* app/text/gimptextlayer-xcf.c
* app/xcf/xcf-load.c: include the private struct for these ugly
corner cases.
svn path=/trunk/; revision=27982
2009-01-17 Michael Natterer <mitch@gimp.org>
* all files with a GPL header and all COPYING files:
Change licence to GPLv3 (and to LGPLv3 for libgimp).
Cleaned up some copyright headers and regenerated the parsers in
the ImageMap plugin.
svn path=/trunk/; revision=27913
2008-10-10 Michael Natterer <mitch@gimp.org>
* app/core/gimpimage.[ch]: add new functions
gimp_image_get_layer_by_index(), _channel_by_index() and
_vectors_by_index().
* app/core/gimpprojection-construct.c
* app/display/gimpdisplayshell-layer-select.c
* app/xcf/xcf-load.c: use them instead of looking the items up
in image->container and casting the return value.
svn path=/trunk/; revision=27206
2008-10-09 Michael Natterer <mitch@gimp.org>
Add GEGL_CFLAGS and #includes as if gimpdrawable.h and gimpimage.h
had a GEGL dependency (they will have in the next commit, but I
wanted to keep the commit separate).
* app/dialogs/Makefile.am
* app/file/Makefile.am
* app/gui/Makefile.am
* app/menus/Makefile.am
* app/paint/Makefile.am
* app/plug-in/Makefile.am
* app/text/Makefile.am
* app/vectors/Makefile.am
* app/widgets/Makefile.am
* app/xcf/Makefile.am: add GEGL_CFLAGS.
* app/actions/*.c
* app/core/*.c
* app/dialogs/*.c
* app/display/*.c
* app/file/*.c
* app/gui/*.c
* app/menus/*.c
* app/paint/*.c
* app/pdb/gimppdb-utils.c
* app/pdb/gimpprocedure.c
* app/plug-in/*.c
* app/text/*.c
* app/tools/*.c
* app/vectors/*.c
* app/widgets/*.c
* app/xcf/*.c: add <gegl.h> or replace <glib-object.h> by <gegl.h>
to all files which include a drawable subclass or gimpimage.h
* tools/pdbgen/app.pl: include <gegl.h> instead of <glib-object.h>
in all generated files.
* app/pdb/*-cmds.c: regenerated.
* data/images/gimp-splash.png: the goat is still sleeping.
By Aurore Derriennic.
svn path=/trunk/; revision=27202
2008-10-09 Michael Natterer <mitch@gimp.org>
Remove the last code duplication from the undo system (or if not
the last then at least the most ugly):
* app/core/gimpimage.[ch] (gimp_image_add_layer,channel,vectors):
add "gboolean push_undo" parameter and add the item without
touching undo if it's TRUE. Changed assertions from
g_object_is_floating() to !gimp_item_is_attached() so they also
take items from the undo stack and not only newly created ones.
(gimp_image_remove_layer,channel,vectors): add "push_undo"
parameter here too. Also add a "new_active" parameter where an
optional new active item can be passed.
(gimp_image_remove_layer,channel): these functions must not be
called with push_undo=FALSE and a floating selection attached to
the layer/channel. This can't currently happen; added warnings in
case other code is changed and makes it happen anyway.
* app/core/gimpchannelundo.c
* app/core/gimplayerundo.c
* app/vectors/gimpvectorsundo.c: use above functions to add/remove
items instead of duplicating (parts of) their code. Pass
push_undo=FALSE and the previously active item to the remove()
functions.
* app/actions/channels-commands.c
* app/actions/edit-commands.c
* app/actions/layers-commands.c
* app/actions/vectors-commands.c
* app/core/gimp-edit.c
* app/core/gimpchannelundo.c
* app/core/gimpimage-crop.c
* app/core/gimpimage-duplicate.c
* app/core/gimpimage-merge.c
* app/core/gimpimage-quick-mask.c
* app/core/gimpimage-scale.c
* app/core/gimplayer-floating-sel.c
* app/core/gimplayerundo.c
* app/core/gimpselection.c
* app/core/gimptemplate.c
* app/display/gimpdisplayshell-dnd.c
* app/text/gimptext-compat.c
* app/tools/gimptexttool.c
* app/tools/gimpvectortool.c
* app/vectors/gimpvectors-import.c
* app/vectors/gimpvectorsundo.c
* app/widgets/gimpchanneltreeview.c
* app/widgets/gimpitemtreeview.[ch]
* app/widgets/gimplayertreeview.c
* app/widgets/gimptoolbox-dnd.c
* app/widgets/gimpvectorstreeview.c
* app/xcf/xcf-load.c
* tools/pdbgen/pdb/image.pdb
* tools/pdbgen/pdb/paths.pdb: changed accordingly (pass TRUE
unless it's a new image like when loading and XCF file).
* app/pdb/image-cmds.c
* app/pdb/paths-cmds.c: regenerated.
svn path=/trunk/; revision=27200
2008-09-15 Michael Natterer <mitch@gimp.org>
* app/core/gimplayer.[ch] (gimp_layer_add_mask): add GError
parameter and replace g_message() by g_set_error().
* app/core/gimplayermaskundo.c
* app/xcf/xcf-load.c
* app/actions/layers-commands.c: pass NULL errors since these
places know what they are doing. Ha ha...
* tools/pdbgen/pdb/layer.pdb
* tools/pdbgen/pdb/image.pdb: pass the error so we get more real
error messages for failed PDB calls.
* app/pdb/image-cmds.c
* app/pdb/layer-cmds.c: regenerated.
svn path=/trunk/; revision=26948
2008-07-18 Sven Neumann <sven@gimp.org>
* app/core/core-types.h: removed delta_time, delta_x, delta_y,
distance and random from the GimpCoords struct. These don't need
to be kept here and they can't be properly interpolated.
* app/core/gimpcoords.c: changed accordingly.
* app/xcf/xcf-load.c (xcf_load_vector): the size of the
GimpCoords
struct changed.
* app/display/gimpdisplayshell.[ch] (struct _GimpDisplayShell):
added some members to store values from the last event that are
needed in gimp_display_shell_eval_event() and which are not any
longer part of GimpCoords.
* app/display/gimpdisplayshell-coords.c
(gimp_display_shell_eval_event): changed accordingly.
* app/paint/gimppaintoptions.c: calculate a random number when
one
is needed.
* app/paint/gimpbrushcore.c (gimp_brush_core_interpolate):
GimpCoords doesn't have a "random" field any longer.
svn path=/trunk/; revision=26232
2007-12-21 Michael Natterer <mitch@gimp.org>
* app/xcf/xcf-save.c
* app/xcf/xcf-load.c: use accessors for colormap, parasites and
more item, layer, channel and mask properties instead of accessing
the object structs directly. Some minor style cleanups.
svn path=/trunk/; revision=24423