[mutter/wayland] surface-actor: Prevent a dumb crash
- From: Jasper St. Pierre <jstpierre src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter/wayland] surface-actor: Prevent a dumb crash
- Date: Tue, 25 Mar 2014 21:04:51 +0000 (UTC)
commit e30ed6892cc845aa9ba741680e2b274337a242ca
Author: Jasper St. Pierre <jstpierre mecheye net>
Date: Tue Mar 25 17:00:43 2014 -0400
surface-actor: Prevent a dumb crash
is_argb32 can be called at any time, including times when we don't
have a texture. In that case, just assume we're ARGB32. The value
really shouldn't be important though.
src/compositor/meta-surface-actor-wayland.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/src/compositor/meta-surface-actor-wayland.c b/src/compositor/meta-surface-actor-wayland.c
index bf9441b..3389b61 100644
--- a/src/compositor/meta-surface-actor-wayland.c
+++ b/src/compositor/meta-surface-actor-wayland.c
@@ -86,6 +86,11 @@ meta_surface_actor_wayland_is_argb32 (MetaSurfaceActor *actor)
MetaShapedTexture *stex = meta_surface_actor_get_texture (actor);
CoglTexture *texture = meta_shaped_texture_get_texture (stex);
+ /* If we don't have a texture, like during initialization, assume
+ * that we're ARGB32. */
+ if (!texture)
+ return TRUE;
+
switch (cogl_texture_get_components (texture))
{
case COGL_TEXTURE_COMPONENTS_A:
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]