Skip to content

onscreen/native: check frame_info for null in finish frame callback

Jeremy Cline requested to merge jeremycline/mutter:onscreen-crash into main

While adjusting the monitor layout of my docked laptop, mutter got a segfault while attempting to dereference the frame_info struct. This happened on gnome-shell 44.4-1.fc38.

cogl_onscreen_peek_head_frame_info() just forwards the call to g_queue_peek_head() which returns NULL in the event that the queue is empty. If finish_frame_result_feedback() is expected to always be called with a non-empty queue there's still a bug somewhere, but regardless this API can legitimately return NULL so it should be checked for prior to dereferencing.

Fixes: 61801a71 ("onscreen/native: Avoid freezing the frame clock on failed cursor commits")

Merge request reports