summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMarius Vlad <marius.vlad@collabora.com>2020-09-09 18:00:22 +0300
committerMarius Vlad <marius.vlad@collabora.com>2020-09-10 19:31:06 +0300
commit8769c76e59ec448bc081f4e89f68622e7185f884 (patch)
tree8b57ea803fa18c78b84fb96a94dd15995a42a533
parentc7bc55dce459ea25f725410fc1b86dd9534a9ed5 (diff)
layout: If no valid output found, abort early with a protocol violation
Spotted by code inspection, but haven't seen in the wild. Bug-AGL: SPEC-3544 Signed-off-by: Marius Vlad <marius.vlad@collabora.com> Change-Id: Ie1f0191e7c987c1688c820e1cabbc581b3679232
-rw-r--r--src/layout.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/layout.c b/src/layout.c
index fa49163..b7f9d4a 100644
--- a/src/layout.c
+++ b/src/layout.c
@@ -316,6 +316,15 @@ ivi_layout_desktop_committed(struct ivi_surface *surf)
if (!r_output)
r_output = ivi_layout_find_bg_output(surf->ivi);
+ /* if we couldn't still find an output by this point, there's
+ * something wrong so we abort with a protocol error */
+ if (!r_output) {
+ wl_resource_post_error(surf->ivi->shell_client.resource,
+ AGL_SHELL_ERROR_INVALID_ARGUMENT,
+ "No valid output found to activate surface by default");
+ return;
+ }
+
/* use the output of the bg to activate the app on start-up by
* default */
if (surf->view && r_output) {