[PATCH] RAOP: Don't crash if fd is not open when trying to close it

David Henningsson david.henningsson at canonical.com
Mon Sep 12 02:23:57 PDT 2011


BugLink: http://bugs.launchpad.net/bugs/845286
Signed-off-by: David Henningsson <david.henningsson at canonical.com>
---
 src/modules/raop/module-raop-sink.c |    8 ++++----
 1 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/src/modules/raop/module-raop-sink.c b/src/modules/raop/module-raop-sink.c
index 422f05c..1fc6d09 100644
--- a/src/modules/raop/module-raop-sink.c
+++ b/src/modules/raop/module-raop-sink.c
@@ -235,10 +235,10 @@ static int sink_process_msg(pa_msgobject *o, int code, void *data, int64_t offse
         }
 
         case SINK_MESSAGE_RIP_SOCKET: {
-            pa_assert(u->fd >= 0);
-
-            pa_close(u->fd);
-            u->fd = -1;
+            if (u->fd >= 0) {
+                pa_close(u->fd);
+                u->fd = -1;
+            }
 
             if (u->sink->thread_info.state == PA_SINK_SUSPENDED) {
 
-- 
1.7.5.4


--------------090704060607060903050101--


More information about the pulseaudio-discuss mailing list