compositor-wayland: Check the return value of wayland_output_create_common
If wayland_output_create_common returns NULL, it means that the output creation failed. Signed-off-by: Sergi Granell <xerpi.g.12@gmail.com> Reviewed-by: Armin Krezović <krezovic.armin@gmail.com> Reviewed-by: Quentin Glidic <sardemff7+git@sardemff7.net>
This commit is contained in:
parent
2dcbb8d20d
commit
7fecb43735
@ -1261,6 +1261,9 @@ wayland_output_create(struct weston_compositor *compositor, const char *name)
|
|||||||
{
|
{
|
||||||
struct wayland_output *output = wayland_output_create_common(name);
|
struct wayland_output *output = wayland_output_create_common(name);
|
||||||
|
|
||||||
|
if (!output)
|
||||||
|
return -1;
|
||||||
|
|
||||||
weston_output_init(&output->base, compositor);
|
weston_output_init(&output->base, compositor);
|
||||||
weston_compositor_add_pending_output(&output->base, compositor);
|
weston_compositor_add_pending_output(&output->base, compositor);
|
||||||
|
|
||||||
@ -1319,9 +1322,13 @@ static int
|
|||||||
wayland_output_create_for_parent_output(struct wayland_backend *b,
|
wayland_output_create_for_parent_output(struct wayland_backend *b,
|
||||||
struct wayland_parent_output *poutput)
|
struct wayland_parent_output *poutput)
|
||||||
{
|
{
|
||||||
struct wayland_output *output = wayland_output_create_common("wlparent");
|
struct wayland_output *output;
|
||||||
struct weston_mode *mode;
|
struct weston_mode *mode;
|
||||||
|
|
||||||
|
output = wayland_output_create_common("wlparent");
|
||||||
|
if (!output)
|
||||||
|
return -1;
|
||||||
|
|
||||||
if (poutput->current_mode) {
|
if (poutput->current_mode) {
|
||||||
mode = poutput->current_mode;
|
mode = poutput->current_mode;
|
||||||
} else if (poutput->preferred_mode) {
|
} else if (poutput->preferred_mode) {
|
||||||
@ -1367,9 +1374,13 @@ out:
|
|||||||
static int
|
static int
|
||||||
wayland_output_create_fullscreen(struct wayland_backend *b)
|
wayland_output_create_fullscreen(struct wayland_backend *b)
|
||||||
{
|
{
|
||||||
struct wayland_output *output = wayland_output_create_common("wayland-fullscreen");
|
struct wayland_output *output;
|
||||||
int width = 0, height = 0;
|
int width = 0, height = 0;
|
||||||
|
|
||||||
|
output = wayland_output_create_common("wayland-fullscreen");
|
||||||
|
if (!output)
|
||||||
|
return -1;
|
||||||
|
|
||||||
weston_output_init(&output->base, b->compositor);
|
weston_output_init(&output->base, b->compositor);
|
||||||
|
|
||||||
output->base.scale = 1;
|
output->base.scale = 1;
|
||||||
|
Loading…
Reference in New Issue
Block a user