Fix errors with WAVs containing markers (#2617).
[dcpomatic.git] / src / lib / ffmpeg_decoder.cc
index efe1515302dcfc5170119030aacd01f9b8b03fd1..c3d32bc752306abd1beb81f6042a80a9bc9acc9c 100644 (file)
@@ -266,6 +266,10 @@ deinterleave_audio(AVFrame* frame)
        auto audio = make_shared<AudioBuffers>(channels, frames);
        auto data = audio->data();
 
+       if (frames == 0) {
+               return audio;
+       }
+
        switch (format) {
        case AV_SAMPLE_FMT_U8:
        {