From 5b077a9232bc37ec89f8a2282fbfc007400f4b86 Mon Sep 17 00:00:00 2001 From: lloyd konneker Date: Wed, 13 Nov 2024 07:38:06 -0500 Subject: [PATCH] Fix #12344 PDF export crash w stack smash on flatpak Fix overflowing RGB array on the stack. Revise comments to say painting opaque. --- plug-ins/common/file-pdf-export.c | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/plug-ins/common/file-pdf-export.c b/plug-ins/common/file-pdf-export.c index c509f49732..d1e0d8751b 100644 --- a/plug-ins/common/file-pdf-export.c +++ b/plug-ins/common/file-pdf-export.c @@ -761,8 +761,9 @@ pdf_export_image (GimpProcedure *procedure, layers = gimp_image_get_layers (image); n_layers = gimp_core_object_array_get_length ((GObject **) layers); - /* Fill image with background color if transparent and - * user chose that option. + /* First fill image with opaque background color + * when last layer has transparency and user chose that option. + * Later we paint the same layer and others layers with transparency. */ if (gimp_drawable_has_alpha (GIMP_DRAWABLE (layers[n_layers - 1])) && fill_background_color) @@ -774,7 +775,7 @@ pdf_export_image (GimpProcedure *procedure, gimp_image_get_width (image), gimp_image_get_height (image)); color = gimp_context_get_background (); - gegl_color_get_pixel (color, babl_format_with_space ("R'G'B'A double", NULL), rgb); + gegl_color_get_pixel (color, babl_format_with_space ("R'G'B' double", NULL), rgb); cairo_set_source_rgb (cr, rgb[0], rgb[1], rgb[2]); cairo_fill (cr);