shell: Avoid creating and inserting black surface 33/25433/2
authorMarius Vlad <marius.vlad@collabora.com>
Tue, 6 Oct 2020 06:51:42 +0000 (09:51 +0300)
committerMarius Vlad <marius.vlad@collabora.com>
Sun, 18 Oct 2020 14:32:41 +0000 (17:32 +0300)
Creating and inserting the black surface will require to have an
valid weston output. That might not be always the case so guard
against no output being set.

Bug-AGL: SPEC-3601

Signed-off-by: Marius Vlad <marius.vlad@collabora.com>
Change-Id: If7034bf0259fee164ba0f4b6a6ac3ef7d6bf30d6

src/shell.c

index e6fb332..b09c909 100644 (file)
@@ -581,6 +581,9 @@ create_black_surface_view(struct ivi_output *output)
        struct weston_compositor *wc= ivi->compositor;
        struct weston_output *woutput = output->output;
 
+       if (!woutput)
+               return;
+
        surface = weston_surface_create(wc);
        view = weston_view_create(surface);
 
@@ -628,9 +631,9 @@ insert_black_surface(struct ivi_output *output)
 {
        struct weston_view *view;
 
-       if (!output &&
+       if ((!output &&
            !output->fullscreen_view.fs &&
-           !output->fullscreen_view.fs->view) {
+           !output->fullscreen_view.fs->view) || !output->output) {
                weston_log("Output %s doesn't have a surface installed!\n", output->name);
                return;
        }