summaryrefslogtreecommitdiff
path: root/src/pixman-renderer.c
diff options
context:
space:
mode:
authorAnder Conselvan de Oliveira <ander.conselvan.de.oliveira@intel.com>2013-01-25 15:13:06 +0200
committerKristian Høgsberg <krh@bitplanet.net>2013-01-27 14:33:08 -0500
commit23e72b867ae1d1b7e5023babd815fd91625c8309 (patch)
treee875222e25ffd7df0553b7ac973ff16e87d240c3 /src/pixman-renderer.c
parent5fb44141bf8eda807a742f8ab264306826c39bd2 (diff)
downloadweston-23e72b867ae1d1b7e5023babd815fd91625c8309.tar.gz
weston-23e72b867ae1d1b7e5023babd815fd91625c8309.tar.bz2
weston-23e72b867ae1d1b7e5023babd815fd91625c8309.zip
pixman-renderer: Don't unreference NULL hw_buffer image
If the buffer for an output was never set, or was reset to NULL at some point, destroying the renderer output private would cause a crash.
Diffstat (limited to 'src/pixman-renderer.c')
-rw-r--r--src/pixman-renderer.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/pixman-renderer.c b/src/pixman-renderer.c
index 77ae99ef..8d95197e 100644
--- a/src/pixman-renderer.c
+++ b/src/pixman-renderer.c
@@ -507,7 +507,9 @@ pixman_renderer_output_destroy(struct weston_output *output)
struct pixman_output_state *po = get_output_state(output);
pixman_image_unref(po->shadow_image);
- pixman_image_unref(po->hw_buffer);
+
+ if (po->hw_buffer)
+ pixman_image_unref(po->hw_buffer);
po->shadow_image = NULL;
po->hw_buffer = NULL;