Crash when pasting from Firefox to GIMP then from GIMP to LibreOffice Impress
GIMP version: 2.10.22
Operating System: Arch Linux
Package: Official Arch package
Description of the bug
When pasting an image from Firefox to GIMP (without an open drawing), then from GIMP to LibreOffice Impress, I found GIMP immediately crashed with the error
The program 'gimp' received an X Window System error.
This probably reflects a bug in the program.
The error was 'BadWindow (invalid Window parameter)'.
(Details: serial 32477 error_code 3 request_code 18 minor_code 0)
(Note to programmers: normally, X errors are reported asynchronously;
that is, you will receive the error a while after causing it.
To debug your program, run it with the --sync command line
option to change this behavior. You can then get a meaningful
backtrace from your debugger if you break on the gdk_x_error() function.)
(script-fu:209925): LibGimpBase-WARNING **: 14:57:20.316: script-fu: gimp_wire_read(): error
This bug only seems to happen with some images (e.g. this one). Following the steps below with other images, such as this one, don't trigger the crash for me.
Editing the crash image with GIMP after pasting from Firefox seems to still cause the crash once pasted to LibreOffice Impress.
Reproduction
Is the bug reproducible? Always (with certain image)
Reproduction steps:
- Open an image in Firefox (I used 85.0.1 installed via the official Arch repo). I used this one.
- Right click on the image and click "Copy Image".
- Open GIMP. Without creating a new drawing, paste the image using Ctrl + V. GIMP will create a new drawing with the same size as the clipboard image, create a new layer with the pasted image, and show a selection box around the drawing.
- Ensure the drawing is selected by pressing Ctrl + A, then copy the drawing to the clipboard again with Ctrl + C.
- Open LibreOffice Impress (7.1.0.3 10(Build:3)), create a new presentation and try to paste the copied image with Ctrl + V. GIMP will immediately crash with the error shown above.
…
Expected result: GIMP does not crash when pasting to LibreOffice Impress.
Actual result: GIMP crashes.