summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Weißschuh <thomas@t-8ch.de>2022-02-01 08:53:38 +0100
committerPhilip Langdale <github.philipl@overt.org>2022-02-06 22:44:40 -0800
commit09343bc86e8bd7935fcc40f3645427a38e4b017a (patch)
tree5f09a3d51289625b221c109f65a9c81f83b804ae
parentb7a71ea70671f3cc991f5d90a411f017caf573c7 (diff)
downloadmpv-09343bc86e8bd7935fcc40f3645427a38e4b017a.tar.bz2
mpv-09343bc86e8bd7935fcc40f3645427a38e4b017a.tar.xz
ao_pipewire: validate pod creation
Our allocated buffers should be big enough, but add some errorhandling just in case.
-rw-r--r--audio/out/ao_pipewire.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/audio/out/ao_pipewire.c b/audio/out/ao_pipewire.c
index 6749270e18..c61c0b4f69 100644
--- a/audio/out/ao_pipewire.c
+++ b/audio/out/ao_pipewire.c
@@ -166,6 +166,10 @@ static void on_param_changed(void *userdata, uint32_t id, const struct spa_pod *
SPA_PARAM_BUFFERS_blocks, SPA_POD_Int(ao->num_planes),
SPA_PARAM_BUFFERS_size, SPA_POD_Int(buffer_size),
SPA_PARAM_BUFFERS_stride, SPA_POD_Int(ao->sstride));
+ if (!params[0]) {
+ MP_ERR(ao, "Could not build parameter pod\n");
+ return;
+ }
pw_stream_update_params(p->stream, params, 1);
}
@@ -409,6 +413,8 @@ static int init(struct ao *ao)
audio_info.position[i] = mp_speaker_id_to_spa(ao, ao->channels.speaker[i]);
params[0] = spa_format_audio_raw_build(&b, SPA_PARAM_EnumFormat, &audio_info);
+ if (!params[0])
+ goto error;
if (af_fmt_is_planar(ao->format)) {
ao->num_planes = ao->channels.num;