From d46b6e4e0eddf914c8861c4daec0cd9316398d3b Mon Sep 17 00:00:00 2001 From: Lukas Oberhuber Date: Sun, 20 Apr 2025 15:51:49 +0100 Subject: [PATCH] app: Partial fix for #13702 infinite loop on startup If somehow an image is not passed when opened from the command line, this avoids an infinite loop as was seen in #13702 This still does not solve the issue of how a bad image was passed in in the first place. --- app/file/file-open.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/app/file/file-open.c b/app/file/file-open.c index 75337234b5..1dd27c293d 100644 --- a/app/file/file-open.c +++ b/app/file/file-open.c @@ -749,6 +749,11 @@ static void file_open_sanitize_image (GimpImage *image, gboolean as_new) { + /* This should never occur, but apparently it does sometimes #13702 + * Avoids infinite loop in the while statement below. + */ + g_return_if_fail (GIMP_IS_IMAGE (image)); + if (as_new) gimp_image_set_file (image, NULL);