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 protected]>
---
 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


** Changed in: pulseaudio (Ubuntu)
       Status: New => In Progress

** Changed in: pulseaudio (Ubuntu)
     Assignee: (unassigned) => David Henningsson (diwic)

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/1058200

Title:
  [sound]: gnome-control-center crashed with SIGABRT in
  pa_memblock_acquire()

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/pulseaudio/+bug/1058200/+subscriptions

-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to