From ef8c428ef90484d7a5bfc24879078963882c0a6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jonas=20=C3=85dahl?= Date: Tue, 31 Aug 2021 09:47:59 +0200 Subject: [PATCH] background-image: Properly clear the failed to be filled texture pointer Otherwise we'll unref and effectively free it, eventually resulting in use after free, causing wierd issues like crashes and infinite recursions. Related: https://bugzilla.redhat.com/show_bug.cgi?id=1989726 Part-of: --- src/compositor/meta-background-image.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/compositor/meta-background-image.c b/src/compositor/meta-background-image.c index c23eef909..1e756bd2a 100644 --- a/src/compositor/meta-background-image.c +++ b/src/compositor/meta-background-image.c @@ -199,8 +199,9 @@ file_loaded (GObject *source_object, pixels, 0, &local_error)) { - g_warning ("Failed to create texture for background"); - cogl_object_unref (texture); + g_warning ("Failed to create texture for background: %s", + local_error->message); + cogl_clear_object (&texture); } image->texture = texture;