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:
Jehan 2024-10-28 02:03:57 +01:00
parent 4ee549b4eb
commit e02b8819e5
4 changed files with 4 additions and 4 deletions

View File

@ -290,7 +290,7 @@ image_select_polygon_invoker (GimpProcedure *procedure,
gboolean success = TRUE;
GimpImage *image;
gint operation;
gint num_segs;
gsize num_segs;
const gdouble *segs;
image = g_value_get_object (gimp_value_array_index (args, 0));

View File

@ -372,7 +372,7 @@ gimp_image_select_ellipse (GimpImage *image,
gboolean
gimp_image_select_polygon (GimpImage *image,
GimpChannelOps operation,
gint num_segs,
gsize num_segs,
const gdouble *segs)
{
GimpValueArray *args;

View File

@ -63,7 +63,7 @@ gboolean gimp_image_select_ellipse (GimpImage *image,
gdouble height);
gboolean gimp_image_select_polygon (GimpImage *image,
GimpChannelOps operation,
gint num_segs,
gsize num_segs,
const gdouble *segs);
gboolean gimp_image_select_item (GimpImage *image,
GimpChannelOps operation,

View File

@ -351,7 +351,7 @@ HELP
{ name => 'segs', type => 'floatarray',
desc => 'Array of points: { p1.x, p1.y, p2.x, p2.y, ...,
pn.x, pn.y}',
array => { type => '2 <= int32',
array => { type => '2 <= size',
desc => 'Number of points (count 1 coordinate as two
points)' } }
);