From 0c18aa51adf3abbdc63b393e05b39929191ae6db Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20B=C3=A4chler?= Date: Tue, 20 Mar 2018 14:05:50 +0100 Subject: [PATCH] playback: pulseaudio: Panic in write if data is empty --- playback/src/audio_backend/pulseaudio.rs | 1 + 1 file changed, 1 insertion(+) diff --git a/playback/src/audio_backend/pulseaudio.rs b/playback/src/audio_backend/pulseaudio.rs index 30074c1d..88f62806 100644 --- a/playback/src/audio_backend/pulseaudio.rs +++ b/playback/src/audio_backend/pulseaudio.rs @@ -112,6 +112,7 @@ impl Sink for PulseAudioSink { } else { let ptr = data.as_ptr() as *const libc::c_void; let len = data.len() as usize * mem::size_of::(); + assert!(len > 0); call_pulseaudio( |err| unsafe { pa_simple_write(self.s, ptr, len, err) }, |ret| ret < 0,