mutter: fix segfault in meta_wayland_init_egl

Upstream issue: https://gitlab.gnome.org/GNOME/mutter/-/work_items/5204
Upstream MR: https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/5470

Fixes https://github.com/NixOS/nixpkgs/issues/587731
This commit is contained in:
Tom Hunze
2026-12-02 00:31:32 +01:00
parent 737f51234e
commit 655e0f0c23
2 changed files with 42 additions and 0 deletions

View File

@@ -0,0 +1,35 @@
From 6081255a7fee3f2bfa0b1351a29cf7a3c3e26a0d Mon Sep 17 00:00:00 2001
From: Thomas Booker <tw.booker@outlook.com>
Date: Thu, 12 Nov 2026 21:55:37 +1300
Subject: [PATCH] cogl: Fix possible null error return in set_egl_error
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
If set_egl_error gets EGL_SUCCESS it should still set error so that
subsequent functions don't derefence a null pointer.
Closes: #5204
Co-authored-by: Michel Dänzer <mdaenzer@redhat.com>
Co-authored-by: Tom Hunze <dev@thunze.de>
---
cogl/cogl/cogl-renderer-egl.c | 2 --
1 file changed, 2 deletions(-)
diff --git a/cogl/cogl/cogl-renderer-egl.c b/cogl/cogl/cogl-renderer-egl.c
index a997b3d654..851ddbcfdd 100644
--- a/cogl/cogl/cogl-renderer-egl.c
+++ b/cogl/cogl/cogl-renderer-egl.c
@@ -104,8 +104,6 @@ set_egl_error (GError **error)
return;
error_number = eglGetError ();
- if (error_number == EGL_SUCCESS)
- return;
g_set_error_literal (error, COGL_EGL_ERROR,
error_number,
--
2.54.0

View File

@@ -85,6 +85,13 @@ stdenv.mkDerivation (finalAttrs: {
hash = "sha256-DTEdh5AdvLlFGPuJME/r4whSzl2KS++p+H6Fxo7O794=";
};
patches = [
# Fix segfault in `meta_wayland_init_egl`
# Upstream issue: https://gitlab.gnome.org/GNOME/mutter/-/work_items/5204
# Upstream MR: https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/5470
./mutter-fix-cogl-segfault.patch
];
mesonFlags = [
"-Dinstalled_tests=false" # TODO: enable these
"-Dtests=disabled"