ceolin pushed a commit to branch master.

http://git.enlightenment.org/core/enlightenment.git/commit/?id=a524d165bcdc09a07e85f46b1643e2c5548f47de

commit a524d165bcdc09a07e85f46b1643e2c5548f47de
Author: Flavio Ceolin <flavio.ceo...@gmail.com>
Date:   Sat Oct 24 00:22:48 2015 -0200

    modules:mixer: Avoid pa backend from crash
    
    Check the pulseaudio's context error and if info is not null before
    get server's information.
---
 src/modules/mixer/lib/backends/pulseaudio/pulse.c | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/src/modules/mixer/lib/backends/pulseaudio/pulse.c 
b/src/modules/mixer/lib/backends/pulseaudio/pulse.c
index 9122735..da83487 100644
--- a/src/modules/mixer/lib/backends/pulseaudio/pulse.c
+++ b/src/modules/mixer/lib/backends/pulseaudio/pulse.c
@@ -549,6 +549,14 @@ _server_info_cb(pa_context *c, const pa_server_info *info,
 {
    pa_operation *o;
 
+   if (pa_context_errno(c) != PA_OK)
+     {
+        WRN("Could not get pa server info, error: %d", pa_context_errno(c));
+        return;
+     }
+
+   EINA_SAFETY_ON_NULL_RETURN(info);
+
    if (!(o = pa_context_get_sink_info_by_name(c, info->default_sink_name,
                                               _sink_default_cb, userdata)))
      {

-- 


Reply via email to