diff options
| author | Derek Foreman <derekf@osg.samsung.com> | 2016-02-09 16:29:49 -0600 |
|---|---|---|
| committer | Bryce Harrington <bryce@osg.samsung.com> | 2016-03-08 16:55:02 -0800 |
| commit | 1d6e885b1dd7e481c7975f6641632ef107163482 (patch) | |
| tree | bfb488df2ede1273f274c4d62db191942e96b3ef /src/wayland-shm.c | |
| parent | shm: Defer wl_shm_pool_resize if a pool has external references (diff) | |
| download | wayland-1d6e885b1dd7e481c7975f6641632ef107163482.tar wayland-1d6e885b1dd7e481c7975f6641632ef107163482.tar.gz wayland-1d6e885b1dd7e481c7975f6641632ef107163482.tar.bz2 wayland-1d6e885b1dd7e481c7975f6641632ef107163482.tar.lz wayland-1d6e885b1dd7e481c7975f6641632ef107163482.tar.xz wayland-1d6e885b1dd7e481c7975f6641632ef107163482.tar.zst wayland-1d6e885b1dd7e481c7975f6641632ef107163482.zip | |
shm: Log a warning if a shm buffer address is requested when it may be invalid
If wl_shm_buffer_get_data() is called on a shm pool that has an external
reference and a pending resize, then the buffer may be outside the pool's
current mapping.
Log a warning if this happens.
Signed-off-by: Derek Foreman <derekf@osg.samsung.com>
Reviewed-by: Bryce Harrington <bryce@osg.samsung.com>
Diffstat (limited to 'src/wayland-shm.c')
| -rw-r--r-- | src/wayland-shm.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/wayland-shm.c b/src/wayland-shm.c index be3dd3f..5efbd70 100644 --- a/src/wayland-shm.c +++ b/src/wayland-shm.c @@ -387,6 +387,11 @@ wl_shm_buffer_get_data(struct wl_shm_buffer *buffer) if (!buffer->pool) return NULL; + if (buffer->pool->external_refcount && + (buffer->pool->size != buffer->pool->new_size)) + wl_log("Buffer address requested when its parent pool " + "has an external reference and a deferred resize " + "pending.\n"); return buffer->pool->data + buffer->offset; } |
