From e67ce8ae4b9121bbcef2c1dcb61bdb5b9330ad78 Mon Sep 17 00:00:00 2001 From: Carl Hetherington Date: Wed, 27 Sep 2023 00:16:38 +0200 Subject: Fix errors with WAVs containing markers (#2617). I'm not 100% sure about this but they seem to end up giving audio packets with no channels and no frames. Here we handle such packets better. --- src/lib/ffmpeg_decoder.cc | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'src/lib/ffmpeg_decoder.cc') diff --git a/src/lib/ffmpeg_decoder.cc b/src/lib/ffmpeg_decoder.cc index efe151530..c3d32bc75 100644 --- a/src/lib/ffmpeg_decoder.cc +++ b/src/lib/ffmpeg_decoder.cc @@ -266,6 +266,10 @@ deinterleave_audio(AVFrame* frame) auto audio = make_shared(channels, frames); auto data = audio->data(); + if (frames == 0) { + return audio; + } + switch (format) { case AV_SAMPLE_FMT_U8: { -- cgit v1.2.3