summaryrefslogtreecommitdiffstats
path: root/player
diff options
context:
space:
mode:
authorThomas Weißschuh <thomas@t-8ch.de>2022-08-21 16:51:08 +0200
committerPhilip Langdale <github.philipl@overt.org>2022-08-21 08:05:13 -0700
commitbf5c19e05b4817bb169f1ad3c4191be2486c2d8e (patch)
treeee09d70de9fd6b4052fa0ab9c271f1f6b5e06df6 /player
parent37aea112c15958052bcc6d0582593edf3bfead8f (diff)
downloadmpv-bf5c19e05b4817bb169f1ad3c4191be2486c2d8e.tar.bz2
mpv-bf5c19e05b4817bb169f1ad3c4191be2486c2d8e.tar.xz
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
Diffstat (limited to 'player')
-rw-r--r--player/audio.c3
1 files changed, 2 insertions, 1 deletions
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);
}