From b9a106b11c16baa85bbb9f0e25855ace658aad7b Mon Sep 17 00:00:00 2001 From: Lefucjusz Date: Tue, 29 Oct 2024 17:02:10 +0100 Subject: [PATCH] [BH-2081] Fix crash for MP3s with missing Xing frame Fix of the issue that playing large MP3 files with missing Xing frame would result in crash due to minimp3 trying to compute metadata by analyzing the entire file and running out of heap memory. --- module-audio/Audio/decoder/DecoderMP3.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/module-audio/Audio/decoder/DecoderMP3.cpp b/module-audio/Audio/decoder/DecoderMP3.cpp index 6fab9d5a6a0e1e43846fc19fd3c1920169cf4598..7aadf6c9e37087be500114ff809014af8695e961 100644 --- a/module-audio/Audio/decoder/DecoderMP3.cpp +++ b/module-audio/Audio/decoder/DecoderMP3.cpp @@ -23,8 +23,9 @@ namespace audio io->seek_data = this; dec->io = io.get(); - if (mp3dec_ex_open_cb(dec.get(), dec->io, MP3D_SEEK_TO_SAMPLE)) { - LOG_ERROR("Failed to open minimp3"); + const auto decoderStatus = mp3dec_ex_open_cb(dec.get(), dec->io, MP3D_SEEK_TO_SAMPLE | MP3D_DO_NOT_SCAN); + if (decoderStatus != 0) { + LOG_ERROR("Failed to open minimp3, error: %d", decoderStatus); return; }