Stuart Henderson writes: > On 2020/05/01 04:30, Nam Nguyen wrote: >> Stuart Henderson writes: >> >> > On 2020/04/29 15:13, Jacqueline Jolicoeur wrote: >> >> Hi, >> >> >> >> I have noticed gimp-2.10.18p1 crashes everytime I try to open a file. >> >> Removing all my GIMP cache and config files has not resolved it. >> >> >> >> I am aware this was posted earlier. I wanted to report that this bug >> >> still exists as of today with the recent snapshots. >> > >> > We don't have any ideas yet. I haven't been able to reproduce it recently, >> > the crash is in gtk+2 in possibly something theme-related so maybe try a >> > different >> > theme or try a different window manager or desktop environment and see if >> > that >> > makes it go away? >> > >> > The upstream bug is currently at >> > https://gitlab.gnome.org/GNOME/gdk-pixbuf/-/issues/148 >> >> Here is a diff for x11/gtk+2 to fix GIMP crashing. Feedback and tests >> are welcome. > > awesome, thanks! > > Your diff makes sense to me but I would like to have input from someone > upstream who knows the area. Could you post this to the bug on GNOME gitlab > please? Or if you don't have / don't want to make an account do you mind if > I post it?
Thanks. I followed up with upstream. They added my fix upstream, so I backported it here. Here is a fresh diff with better links. https://gitlab.gnome.org/GNOME/gtk/-/commit/fc1bd0cf2c33cd3f34cb48c2a13718a32c2d28b9 https://gitlab.gnome.org/GNOME/gtk/-/issues/2684 Index: Makefile =================================================================== RCS file: /cvs/ports/x11/gtk+2/Makefile,v retrieving revision 1.233 diff -u -p -u -p -r1.233 Makefile --- Makefile 10 Nov 2019 21:44:07 -0000 1.233 +++ Makefile 1 May 2020 23:18:56 -0000 @@ -9,7 +9,7 @@ GNOME_PROJECT= gtk+ PKGNAME-main= gtk+2-${GNOME_VERSION} PKGNAME-cups= gtk+2-cups-${GNOME_VERSION} -REVISION-main= 8 +REVISION-main= 9 REVISION-cups= 4 CATEGORIES= x11 devel Index: patches/patch-modules_engines_pixbuf_pixbuf-render_c =================================================================== RCS file: patches/patch-modules_engines_pixbuf_pixbuf-render_c diff -N patches/patch-modules_engines_pixbuf_pixbuf-render_c --- /dev/null 1 Jan 1970 00:00:00 -0000 +++ patches/patch-modules_engines_pixbuf_pixbuf-render_c 1 May 2020 23:18:56 -0000 @@ -0,0 +1,19 @@ +$OpenBSD$ + +backport fix for graphics/gimp segfault from accessing memory past end of pixbuf + +https://gitlab.gnome.org/GNOME/gtk/-/commit/fc1bd0cf2c33cd3f34cb48c2a13718a32c2d28b9 +https://gitlab.gnome.org/GNOME/gtk/-/issues/2684 + +Index: modules/engines/pixbuf/pixbuf-render.c +--- modules/engines/pixbuf/pixbuf-render.c.orig ++++ modules/engines/pixbuf/pixbuf-render.c +@@ -603,7 +603,7 @@ compute_hint (GdkPixbuf *pixbuf, + if (r != *(p++) || + g != *(p++) || + b != *(p++) || +- (n_channels != 4 && a != *(p++))) ++ (n_channels == 4 && a != *(p++))) + { + hints &= ~THEME_CONSTANT_ROWS; + if (!(hints & THEME_MISSING))