From 263310fe63eed7fc536c100ea42626edce33a946 Mon Sep 17 00:00:00 2001 From: bakkeby Date: Wed, 3 Sep 2025 21:36:44 +0200 Subject: [PATCH] background iamge: bail early if the image could not be loaded from path --- patch/background_image.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/patch/background_image.c b/patch/background_image.c index 4f64c1f5cd2980d4cc57f54e4938fdb35b5e5a85..8d134db46a1cf06e3e3713820b4409565d2fdc9b 100644 --- a/patch/background_image.c +++ b/patch/background_image.c @@ -21,6 +21,12 @@ create_lock_image(Display *dpy) { /* Load picture */ Imlib_Image buffer = imlib_load_image(background_image); + + if (!buffer) { + fprintf(stderr, "Failed to load background image: %s\n", background_image); + return; + } + imlib_context_set_image(buffer); int background_image_width = imlib_image_get_width(); int background_image_height = imlib_image_get_height();