[retro-gtk] pa-player: Check the pa_simple before writing
- From: Adrien Plazas <aplazas src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [retro-gtk] pa-player: Check the pa_simple before writing
- Date: Wed, 8 Nov 2017 07:23:49 +0000 (UTC)
commit a4c26d7a40c21a4394a7232ede5636eff850ae7b
Author: Adrien Plazas <kekun plazas laposte net>
Date: Wed Nov 8 08:13:13 2017 +0100
pa-player: Check the pa_simple before writing
This avoids crashes when the construction of the pa_simple failed.
https://bugzilla.gnome.org/show_bug.cgi?id=781887
retro-gtk/retro-pa-player.c | 3 +++
1 files changed, 3 insertions(+), 0 deletions(-)
---
diff --git a/retro-gtk/retro-pa-player.c b/retro-gtk/retro-pa-player.c
index 0f4f0af..2a6239f 100644
--- a/retro-gtk/retro-pa-player.c
+++ b/retro-gtk/retro-pa-player.c
@@ -82,6 +82,9 @@ retro_pa_player_on_audio_output (RetroCore *sender,
if (self->simple == NULL || sample_rate != self->sample_rate)
retro_pa_player_prepare_for_sample_rate (self, sample_rate);
+ if (self->simple == NULL)
+ return;
+
pa_simple_write (self->simple, data, sizeof (gint16) * length, NULL);
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]