ivi-shell: harden get_ivi_shell_surface()
Add more sanity checks to get_ivi_shell_surface() just in case. If the configure hook is set, we must always have non-NULL configure_private. Check the ivi_shell_surface matches the surface. Signed-off-by: Pekka Paalanen <pekka.paalanen@collabora.co.uk> Reviewed-by: Eugen Friedrich <friedrix@gmail.com>
This commit is contained in:
@@ -81,10 +81,16 @@ ivi_shell_surface_configure(struct weston_surface *, int32_t, int32_t);
|
|||||||
static struct ivi_shell_surface *
|
static struct ivi_shell_surface *
|
||||||
get_ivi_shell_surface(struct weston_surface *surface)
|
get_ivi_shell_surface(struct weston_surface *surface)
|
||||||
{
|
{
|
||||||
if (surface->configure == ivi_shell_surface_configure)
|
struct ivi_shell_surface *shsurf;
|
||||||
return surface->configure_private;
|
|
||||||
|
|
||||||
return NULL;
|
if (surface->configure != ivi_shell_surface_configure)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
shsurf = surface->configure_private;
|
||||||
|
assert(shsurf);
|
||||||
|
assert(shsurf->surface == surface);
|
||||||
|
|
||||||
|
return shsurf;
|
||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
|
|||||||
Reference in New Issue
Block a user