If there is no silence memblock and no data, pa_memblockq_peek can return NULL. In this case, do not crash on an assertion in pa_memblock_acquire, but instead return a proper error to the client.
BugLink: http://bugs.launchpad.net/bugs/1058200 Signed-off-by: David Henningsson <email address hidden> --- src/pulse/stream.c | 2 ++ 1 file changed, 2 insertions(+)
diff --git a/src/pulse/stream.c b/src/pulse/stream.c index 2b6d306..9bb0995 100644 --- a/src/pulse/stream.c +++ b/src/pulse/stream.c @@ -1598,6 +1598,8 @@ int pa_stream_peek(pa_stream *s, const void **data, size_t *length) { return 0; }
+ PA_CHECK_VALIDITY(s->context, s->peek_memchunk.memblock != NULL, PA_ERR_NODATA); + s->peek_data = pa_memblock_acquire(s->peek_memchunk.memblock); }
-- 1.7.9.5
If there is no silence memblock and no data, pa_memblockq_peek can acquire, but instead return a proper error to the client.
return NULL. In this case, do not crash on an assertion in
pa_memblock_
BugLink: http:// bugs.launchpad. net/bugs/ 1058200
Signed-off-by: David Henningsson <email address hidden>
---
src/pulse/stream.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/src/pulse/ stream. c b/src/pulse/ stream. c stream. c stream. c peek(pa_ stream *s, const void **data, size_t *length) {
index 2b6d306..9bb0995 100644
--- a/src/pulse/
+++ b/src/pulse/
@@ -1598,6 +1598,8 @@ int pa_stream_
return 0;
}
+ PA_CHECK_ VALIDITY( s->context, s->peek_ memchunk. memblock != NULL, PA_ERR_NODATA);
s->peek_ data = pa_memblock_ acquire( s->peek_ memchunk. memblock) ;
+
}
--
1.7.9.5