summaryrefslogtreecommitdiff
path: root/src/screenshooter.c
diff options
context:
space:
mode:
authorNeil Roberts <neil@linux.intel.com>2013-11-13 15:44:06 +0000
committerKristian Høgsberg <krh@bitplanet.net>2013-11-13 16:32:58 -0800
commite505171a3254883aedb5f69ab8f090205ba88188 (patch)
tree7700ff6e036333ef8bd38708f361e96930fe62a4 /src/screenshooter.c
parentf707e8145ba8c26811c5dae2b3d00844afc0ffaf (diff)
downloadweston-e505171a3254883aedb5f69ab8f090205ba88188.tar.gz
Add calls to wl_shm_buffer_begin/end_access
This wraps all accesses to an SHM buffer between wl_shm_buffer_begin and end so that wayland-shm can install a handler for SIGBUS and catch attempts to pass the compositor a buffer that is too small.
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 645114d0..0c657bc8 100644
--- a/src/screenshooter.c
+++ b/src/screenshooter.c
@@ -144,6 +144,8 @@ screenshooter_frame_notify(struct wl_listener *listener, void *data)
d = wl_shm_buffer_get_data(l->buffer->shm_buffer);
s = pixels + stride * (l->buffer->height - 1);
+ wl_shm_buffer_begin_access(l->buffer->shm_buffer);
+
switch (compositor->read_format) {
case PIXMAN_a8r8g8b8:
case PIXMAN_x8r8g8b8:
@@ -163,6 +165,8 @@ screenshooter_frame_notify(struct wl_listener *listener, void *data)
break;
}
+ wl_shm_buffer_end_access(l->buffer->shm_buffer);
+
screenshooter_send_done(l->resource);
free(pixels);
free(l);