[gnome-control-center] sound: Don't crash if pa_stream_peek returns NULL



commit 4da83dbba8041c223f9285a7f377c2d6205ab775
Author: David Henningsson <david henningsson canonical com>
Date:   Mon Nov 26 13:26:01 2012 +0100

    sound: Don't crash if pa_stream_peek returns NULL
    
    pa_stream_peek can return NULL, even though it's unusual. In the upcoming
    version of PulseAudio this has been clarified in the documentation.
    
    In that case, don't crash, just call pa_stream_drop so that the
    pointer moves forward.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=689079

 panels/sound/gvc-mixer-dialog.c |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/panels/sound/gvc-mixer-dialog.c b/panels/sound/gvc-mixer-dialog.c
index ea95825..6a7afb5 100644
--- a/panels/sound/gvc-mixer-dialog.c
+++ b/panels/sound/gvc-mixer-dialog.c
@@ -361,6 +361,11 @@ on_monitor_read_callback (pa_stream *s,
                 return;
         }
 
+        if (!data) {
+                pa_stream_drop (s);
+                return;
+        }
+
         assert (length > 0);
         assert (length % sizeof (float) == 0);
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]