[PATCH 01/13] ivi-shell: bugfix, check limitation of ivi_layout_surface opacity

Nobuhiko Tanibata nobuhiko_tanibata at xddp.denso.co.jp
Sun Jun 21 23:29:20 PDT 2015


From: Nobuhiko Tanibata <NOBUHIKO_TANIBATA at xddp.denso.co.jp>

Signed-off-by: Nobuhiko Tanibata <NOBUHIKO_TANIBATA at xddp.denso.co.jp>
Acked-by: Pekka Paalanen <pekka.paalanen at collabora.co.uk>
---
 ivi-shell/ivi-layout.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/ivi-shell/ivi-layout.c b/ivi-shell/ivi-layout.c
index 4aed4c8..50ce22f 100644
--- a/ivi-shell/ivi-layout.c
+++ b/ivi-shell/ivi-layout.c
@@ -2209,7 +2209,9 @@ ivi_layout_surface_set_opacity(struct ivi_layout_surface *ivisurf,
 {
 	struct ivi_layout_surface_properties *prop = NULL;
 
-	if (ivisurf == NULL) {
+	if (ivisurf == NULL ||
+	    opacity < wl_fixed_from_double(0.0) ||
+	    wl_fixed_from_double(1.0) < opacity) {
 		weston_log("ivi_layout_surface_set_opacity: invalid argument\n");
 		return IVI_FAILED;
 	}
-- 
1.8.3.1



More information about the wayland-devel mailing list