onscreen/native: Add missing error messages

g_set_error_literal() asserts that the provided message is not NULL.
If it is NULL, the function is entirely no-op.

This resulted in a NULL dereference of the GError, which remained
NULL in this case, when trying to print a warning in
clutter_stage_cogl_redraw_view().

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/1715>
This commit is contained in:
Dor Askayo 2021-02-07 13:26:03 +02:00 committed by Marge Bot
parent 2c0bd98f21
commit d6abea3ba7

View File

@ -1212,7 +1212,7 @@ meta_onscreen_native_direct_scanout (CoglOnscreen *onscreen,
g_set_error_literal (error,
COGL_SCANOUT_ERROR,
COGL_SCANOUT_ERROR_INHIBITED,
NULL);
"Direct scanout is inhibited during power saving mode");
return FALSE;
}
@ -1221,7 +1221,7 @@ meta_onscreen_native_direct_scanout (CoglOnscreen *onscreen,
g_set_error_literal (error,
COGL_SCANOUT_ERROR,
COGL_SCANOUT_ERROR_INHIBITED,
NULL);
"Direct scanout is inhibited when a mode set is pending");
return FALSE;
}