From bf5c19e05b4817bb169f1ad3c4191be2486c2d8e Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Thomas=20Wei=C3=9Fschuh?= Date: Sun, 21 Aug 2022 16:51:08 +0200 Subject: [PATCH] audio: don't try to drain non-existent AO 52aed495cb ("audio: drain ao on EOF") introduced logic to drain an AO when EOF of the input has been reached. When no AO however is present this leads to a NULL-dereference. Fixes #10556 --- player/audio.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/player/audio.c b/player/audio.c index 051a28f85d..92408ebf99 100644 --- a/player/audio.c +++ b/player/audio.c @@ -945,7 +945,8 @@ void fill_audio_out_buffers(struct MPContext *mpctx) (opts->gapless_audio && !ao_untimed(ao_c->ao)))) { MP_VERBOSE(mpctx, "audio EOF reached\n"); - ao_drain(mpctx->ao); + if (mpctx->ao) + ao_drain(mpctx->ao); mpctx->audio_status = STATUS_EOF; mp_wakeup_core(mpctx); }