From: Derek Foreman Date: Tue, 9 Feb 2016 22:29:49 +0000 (-0600) Subject: shm: Log a warning if a shm buffer address is requested when it may be invalid X-Git-Tag: 1.10.91~24 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=1d6e885b1dd7e481c7975f6641632ef107163482;p=platform%2Fupstream%2Fwayland.git 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 Reviewed-by: Bryce Harrington --- 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; }