summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarius Vlad <marius.vlad@collabora.com>2024-07-16 12:14:34 +0300
committerMarius Vlad <marius.vlad@collabora.com>2024-07-16 12:17:28 +0300
commit1c76c25fb8c6791625f01e9fa493f33732cc67f5 (patch)
treeab69988e889a8da90b8824d811941d5d318cea73
parent0ec604bbc963f5a53c3469bd83cf1d6ad515f135 (diff)
layout: Don't assume we have background surface set-up
set_background request assumes we have set-up a bg surface which might not be the always case. Just avoid dereferencing before testing for a valid background surface role. Bug-AGL: SPEC-5205 Signed-off-by: Marius Vlad <marius.vlad@collabora.com> Reported-by: Scott Murray <scott.murray@konsulko.com> Change-Id: I3481d7eda83c8d6e7605dc0e8fec240029405808 (cherry picked from commit c1610846f53a0d722da97ce33ae02ad89c6b0194)
-rw-r--r--src/layout.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/layout.c b/src/layout.c
index 48c478e..90f7a1b 100644
--- a/src/layout.c
+++ b/src/layout.c
@@ -144,14 +144,14 @@ ivi_background_init(struct ivi_compositor *ivi, struct ivi_output *output)
struct weston_output *woutput = output->output;
struct ivi_surface *bg = output->background;
struct weston_view *view;
- struct weston_surface *wsurface =
- weston_desktop_surface_get_surface(bg->dsurface);
+ struct weston_surface *wsurface;
if (!bg) {
weston_log("WARNING: Output does not have a background\n");
return;
}
+ wsurface = weston_desktop_surface_get_surface(bg->dsurface);
assert(bg->role == IVI_SURFACE_ROLE_BACKGROUND);
view = bg->view;