app, libgimp, pdb: fix “Stack smashing detected” crash.
Building with clang and various stack protection flags (as is done in our flatpak apparently), we can trigger a crash when a gint on the stack is set as a pointer to gsize. Anyway now all array size must be gsize. See: https://discourse.gnome.org/t/problem-with-select-polygon-in-gimp-2-99/24753
This commit is contained in:
@ -290,7 +290,7 @@ image_select_polygon_invoker (GimpProcedure *procedure,
|
|||||||
gboolean success = TRUE;
|
gboolean success = TRUE;
|
||||||
GimpImage *image;
|
GimpImage *image;
|
||||||
gint operation;
|
gint operation;
|
||||||
gint num_segs;
|
gsize num_segs;
|
||||||
const gdouble *segs;
|
const gdouble *segs;
|
||||||
|
|
||||||
image = g_value_get_object (gimp_value_array_index (args, 0));
|
image = g_value_get_object (gimp_value_array_index (args, 0));
|
||||||
|
@ -372,7 +372,7 @@ gimp_image_select_ellipse (GimpImage *image,
|
|||||||
gboolean
|
gboolean
|
||||||
gimp_image_select_polygon (GimpImage *image,
|
gimp_image_select_polygon (GimpImage *image,
|
||||||
GimpChannelOps operation,
|
GimpChannelOps operation,
|
||||||
gint num_segs,
|
gsize num_segs,
|
||||||
const gdouble *segs)
|
const gdouble *segs)
|
||||||
{
|
{
|
||||||
GimpValueArray *args;
|
GimpValueArray *args;
|
||||||
|
@ -63,7 +63,7 @@ gboolean gimp_image_select_ellipse (GimpImage *image,
|
|||||||
gdouble height);
|
gdouble height);
|
||||||
gboolean gimp_image_select_polygon (GimpImage *image,
|
gboolean gimp_image_select_polygon (GimpImage *image,
|
||||||
GimpChannelOps operation,
|
GimpChannelOps operation,
|
||||||
gint num_segs,
|
gsize num_segs,
|
||||||
const gdouble *segs);
|
const gdouble *segs);
|
||||||
gboolean gimp_image_select_item (GimpImage *image,
|
gboolean gimp_image_select_item (GimpImage *image,
|
||||||
GimpChannelOps operation,
|
GimpChannelOps operation,
|
||||||
|
@ -351,7 +351,7 @@ HELP
|
|||||||
{ name => 'segs', type => 'floatarray',
|
{ name => 'segs', type => 'floatarray',
|
||||||
desc => 'Array of points: { p1.x, p1.y, p2.x, p2.y, ...,
|
desc => 'Array of points: { p1.x, p1.y, p2.x, p2.y, ...,
|
||||||
pn.x, pn.y}',
|
pn.x, pn.y}',
|
||||||
array => { type => '2 <= int32',
|
array => { type => '2 <= size',
|
||||||
desc => 'Number of points (count 1 coordinate as two
|
desc => 'Number of points (count 1 coordinate as two
|
||||||
points)' } }
|
points)' } }
|
||||||
);
|
);
|
||||||
|
Reference in New Issue
Block a user