From d9d67f267e6906f7d2f8212081f32b7d58d4afa2 Mon Sep 17 00:00:00 2001 From: rbuj Date: Sat, 27 Nov 2021 11:16:04 +0100 Subject: mate-bg: Dereference of null pointer --- libmate-desktop/mate-bg.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libmate-desktop') diff --git a/libmate-desktop/mate-bg.c b/libmate-desktop/mate-bg.c index 46086d5..5d32425 100644 --- a/libmate-desktop/mate-bg.c +++ b/libmate-desktop/mate-bg.c @@ -2316,7 +2316,7 @@ find_best_size (GSList *sizes, gint width, gint height) best = size; } else if (d == distance) { - if (abs (size->width - width) < abs (best->width - width)) { + if (best && (abs (size->width - width) < abs (best->width - width))) { best = size; } } -- cgit v1.2.1