onscreen/native: Fix cast from CoglOnscreenEgl

It used the defunct platform pointer, meaning if this path would have
hit, it'd end up with a segmentation fault due to the platform pointer
being NULL.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1759>
This commit is contained in:
Jonas Ådahl 2021-03-08 11:07:58 +01:00 committed by Marge Bot
parent 372737e282
commit b962822f26

View File

@ -2032,8 +2032,7 @@ destroy_egl_surface (CoglOnscreen *onscreen)
egl_surface = cogl_onscreen_egl_get_egl_surface (onscreen_egl);
if (cogl_onscreen_egl_get_egl_surface (onscreen_egl) != EGL_NO_SURFACE)
{
MetaOnscreenNative *onscreen_native =
cogl_onscreen_egl_get_platform (onscreen_egl);
MetaOnscreenNative *onscreen_native = META_ONSCREEN_NATIVE (onscreen);
MetaEgl *egl = meta_onscreen_native_get_egl (onscreen_native);
CoglFramebuffer *framebuffer = COGL_FRAMEBUFFER (onscreen);
CoglContext *cogl_context = cogl_framebuffer_get_context (framebuffer);