<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">On Fri, Jun 26, 2015 at 6:35 PM, Derek Foreman <span dir="ltr"><<a href="mailto:derekf@osg.samsung.com" target="_blank">derekf@osg.samsung.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">There's no situation where a shm buffer without a pool makes sense,<br>
so we enforce the pool's existence a little more rigidly.<br>
<br>
Signed-off-by: Derek Foreman <<a href="mailto:derekf@osg.samsung.com">derekf@osg.samsung.com</a>><br>
---<br>
src/wayland-shm.c | 10 ++++++----<br>
1 file changed, 6 insertions(+), 4 deletions(-)<br>
<br>
diff --git a/src/wayland-shm.c b/src/wayland-shm.c<br>
index da11743..79b3886 100644<br>
--- a/src/wayland-shm.c<br>
+++ b/src/wayland-shm.c<br>
@@ -353,10 +353,12 @@ wl_shm_buffer_get_stride(struct wl_shm_buffer *buffer)<br>
WL_EXPORT void *<br>
wl_shm_buffer_get_data(struct wl_shm_buffer *buffer)<br>
{<br>
- if (buffer->pool)<br>
- return buffer->pool->data + buffer->offset;<br>
- else<br>
- return buffer + 1;<br>
+ assert(buffer->pool);<br>
+<br>
+ if (!buffer->pool)<br>
+ return NULL;<br></blockquote><div><br></div><div>This condition is never true if the assert passed<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
+<br>
+ return buffer->pool->data + buffer->offset;<br>
}<br>
<br>
WL_EXPORT uint32_t<br>
<span class="HOEnZb"><font color="#888888">--<br>
2.1.4<br>
<br>
_______________________________________________<br>
wayland-devel mailing list<br>
<a href="mailto:wayland-devel@lists.freedesktop.org">wayland-devel@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/wayland-devel" rel="noreferrer" target="_blank">http://lists.freedesktop.org/mailman/listinfo/wayland-devel</a><br></font></span></blockquote><div><br></div><div>Regards,<br></div><div>Marek <br></div></div><br></div></div>