Re: [PATCH weston 3/5] ivi-shell: add sanity check in ivi_shell_surface_configure

2016-03-24 Thread Eugen Friedrich
2016-03-22 15:48 GMT+01:00 Pekka Paalanen :

> From: Pekka Paalanen 
>
> This should not get called unless there is an ivi_shell_surface.
>
> Signed-off-by: Pekka Paalanen 
> ---
>  ivi-shell/ivi-shell.c | 6 +-
>  1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/ivi-shell/ivi-shell.c b/ivi-shell/ivi-shell.c
> index 9c11f6f..d136f46 100644
> --- a/ivi-shell/ivi-shell.c
> +++ b/ivi-shell/ivi-shell.c
> @@ -108,7 +108,11 @@ ivi_shell_surface_configure(struct weston_surface
> *surface,
>  {
> struct ivi_shell_surface *ivisurf = get_ivi_shell_surface(surface);
>
> -   if (surface->width == 0 || surface->height == 0 || ivisurf == NULL)
> +   assert(ivisurf);
> +   if (!ivisurf)
> +   return;
> +
> +   if (surface->width == 0 || surface->height == 0)
> return;
>
> if (ivisurf->width != surface->width ||
> --
> 2.7.3
>
> ___
> wayland-devel mailing list
> wayland-devel@lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/wayland-devel
>
Looks good
Reviewed-by: Eugen Friedrich 
___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/wayland-devel


[PATCH weston 3/5] ivi-shell: add sanity check in ivi_shell_surface_configure

2016-03-22 Thread Pekka Paalanen
From: Pekka Paalanen 

This should not get called unless there is an ivi_shell_surface.

Signed-off-by: Pekka Paalanen 
---
 ivi-shell/ivi-shell.c | 6 +-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/ivi-shell/ivi-shell.c b/ivi-shell/ivi-shell.c
index 9c11f6f..d136f46 100644
--- a/ivi-shell/ivi-shell.c
+++ b/ivi-shell/ivi-shell.c
@@ -108,7 +108,11 @@ ivi_shell_surface_configure(struct weston_surface *surface,
 {
struct ivi_shell_surface *ivisurf = get_ivi_shell_surface(surface);
 
-   if (surface->width == 0 || surface->height == 0 || ivisurf == NULL)
+   assert(ivisurf);
+   if (!ivisurf)
+   return;
+
+   if (surface->width == 0 || surface->height == 0)
return;
 
if (ivisurf->width != surface->width ||
-- 
2.7.3

___
wayland-devel mailing list
wayland-devel@lists.freedesktop.org
https://lists.freedesktop.org/mailman/listinfo/wayland-devel