summaryrefslogtreecommitdiff
path: root/src/screenshooter.c
diff options
context:
space:
mode:
authorKristian Høgsberg <krh@bitplanet.net>2013-08-15 12:26:42 -0700
committerKristian Høgsberg <krh@bitplanet.net>2013-08-15 12:26:42 -0700
commit08b58c7c125a63d6902bbe2eb073dd72f3f006b5 (patch)
tree394d88d23ab4f90f841d4c9d781c51b7f154218d /src/screenshooter.c
parent980b0188250a03ca372b7486075dd43e92e603a7 (diff)
downloadweston-08b58c7c125a63d6902bbe2eb073dd72f3f006b5.tar.gz
compositor: Handle OOM in weston_buffer_from_resource()
Handle NULL-return in call-sites as well.
Diffstat (limited to 'src/screenshooter.c')
-rw-r--r--src/screenshooter.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/src/screenshooter.c b/src/screenshooter.c
index 24140151..a89194ee 100644
--- a/src/screenshooter.c
+++ b/src/screenshooter.c
@@ -180,6 +180,10 @@ screenshooter_shoot(struct wl_client *client,
struct weston_buffer *buffer =
weston_buffer_from_resource(buffer_resource);
+ if (buffer == NULL) {
+ wl_resource_post_no_memory(resource);
+ return;
+ }
if (!wl_shm_buffer_get(buffer->resource))
return;