diff options
author | Wim Taymans <wtaymans@redhat.com> | 2020-09-07 14:57:47 +0200 |
---|---|---|
committer | Wim Taymans <wtaymans@redhat.com> | 2020-09-07 14:57:47 +0200 |
commit | b6e84ded756dd2d777b729d11a7bacb1d1abd1bf (patch) | |
tree | 0688f0a62bb4576614340c14294f397085830ef9 /pipewire-alsa | |
parent | 71441565fd8dcc73949a3091151665813a591431 (diff) |
alsa: protect against SIGPFE
Make sure we don't try to divide by 0 when the app calls the status
before we are PREPARED.
Fixes #283
Diffstat (limited to 'pipewire-alsa')
-rw-r--r-- | pipewire-alsa/alsa-plugins/pcm_pipewire.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/pipewire-alsa/alsa-plugins/pcm_pipewire.c b/pipewire-alsa/alsa-plugins/pcm_pipewire.c index 8520274f..f2db3af5 100644 --- a/pipewire-alsa/alsa-plugins/pcm_pipewire.c +++ b/pipewire-alsa/alsa-plugins/pcm_pipewire.c @@ -168,6 +168,8 @@ static snd_pcm_sframes_t snd_pcm_pipewire_pointer(snd_pcm_ioplug_t *io) return -EPIPE; if (pw->error < 0) return pw->error; + if (io->buffer_size == 0) + return 0; #ifdef SND_PCM_IOPLUG_FLAG_BOUNDARY_WA return pw->hw_ptr; #else |