From ac43fc9f5c03cb5df9058759cbc1f3d137f3033f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Sch=C3=BCrmann?= Date: Sun, 24 Dec 2023 01:22:52 +0100 Subject: [PATCH 1/3] Report mp3 file offset in case of decoding issues --- src/sources/soundsourcemp3.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/sources/soundsourcemp3.cpp b/src/sources/soundsourcemp3.cpp index 023cf8e8dc2..6d9fae0d8c0 100644 --- a/src/sources/soundsourcemp3.cpp +++ b/src/sources/soundsourcemp3.cpp @@ -130,7 +130,8 @@ bool decodeFrameHeader( } if (isUnrecoverableError(pMadStream->error)) { kLogger.warning() << "Unrecoverable MP3 header decoding error:" - << mad_stream_errorstr(pMadStream); + << mad_stream_errorstr(pMadStream) + << pMadStream->this_frame - pMadStream->buffer; return false; } if ((pMadStream->error == MAD_ERROR_LOSTSYNC) && skipId3Tag) { @@ -148,7 +149,8 @@ bool decodeFrameHeader( // worry users when logged as a warning. The issue will become // obsolete once we switched to FFmpeg for MP3 decoding. kLogger.info() << "Recoverable MP3 header decoding error:" - << mad_stream_errorstr(pMadStream); + << mad_stream_errorstr(pMadStream) + << pMadStream->this_frame - pMadStream->buffer; logFrameHeader(kLogger.info(), *pMadHeader); return false; } @@ -731,7 +733,7 @@ ReadableSampleFrames SoundSourceMp3::readSampleFramesClamped( if (madFrameChannelCount != getSignalInfo().getChannelCount()) { kLogger.warning() << "MP3 frame header with mismatching number of channels" << madFrameChannelCount << "<>" << getSignalInfo().getChannelCount() - << " - aborting"; + << " - aborting @" << m_madStream.this_frame - m_madStream.buffer; abortReading = true; } #endif From 0e92904f3f683b8bcc7bf0b55d7f41222c5bbef1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Sch=C3=BCrmann?= Date: Sun, 24 Dec 2023 01:33:10 +0100 Subject: [PATCH 2/3] mp3: Add missing sanity check for bit rates in free format. This prevents to abort decoding when files have some garbage similar to a valid header. --- src/sources/soundsourcemp3.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/sources/soundsourcemp3.cpp b/src/sources/soundsourcemp3.cpp index 6d9fae0d8c0..ea6d228065e 100644 --- a/src/sources/soundsourcemp3.cpp +++ b/src/sources/soundsourcemp3.cpp @@ -121,7 +121,18 @@ bool decodeFrameHeader( mad_stream* pMadStream, bool skipId3Tag) { DEBUG_ASSERT(!hasUnrecoverableError(pMadStream)); - if (mad_header_decode(pMadHeader, pMadStream)) { + int ret = mad_header_decode(pMadHeader, pMadStream); + if (pMadHeader->flags & MAD_FLAG_FREEFORMAT) { + // perform missing sanity check for Layer I and II + // See libmad frame.c free_bitrate() + if ((pMadHeader->layer == MAD_LAYER_I && pMadHeader->bitrate > 896000) || + (pMadHeader->layer == MAD_LAYER_II && pMadHeader->bitrate > 768000)) { + pMadStream->error = MAD_ERROR_LOSTSYNC; + pMadStream->sync = 0; + ret = -1; + } + } + if (ret) { // Something went wrong when decoding the frame header... DEBUG_ASSERT(pMadStream->error != MAD_ERROR_NONE); if (MAD_ERROR_BUFLEN == pMadStream->error) { From 17570378b4a93443b54e39a0ea8d5242667bcf5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Sch=C3=BCrmann?= Date: Sun, 24 Dec 2023 15:28:08 +0100 Subject: [PATCH 3/3] Add a unit-test that shows the that the free mode garbage issue is fxed. --- src/test/id3-test-data/free_mode_garbage.mp3 | Bin 0 -> 21934 bytes src/test/soundproxy_test.cpp | 17 +++++++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 src/test/id3-test-data/free_mode_garbage.mp3 diff --git a/src/test/id3-test-data/free_mode_garbage.mp3 b/src/test/id3-test-data/free_mode_garbage.mp3 new file mode 100644 index 0000000000000000000000000000000000000000..bcd3960f732b60c7de554c29d43ed110dca66bee GIT binary patch literal 21934 zcmX8ZWk8eP-v)3RMsIWqV{~`-fYA*jr5mIL1SLktMt65egNVS7*l3VW0}zl@D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fcv$ zs0X|mr~>6_db=Vp|A_?qebY2A;nfcy000T2@rtIpQ9zE-n^ z96~!;ty{eo!LP~T$KAO#wF7k3xJE{>Ue{52H_~{M&uDT7O69}AYIc>@gpq-8nziCl zH6u$^z88{8ZnlaJ%oOF8N35ej%ziL+886A_(y5zCdO+yDRo literal 0 HcmV?d00001 diff --git a/src/test/soundproxy_test.cpp b/src/test/soundproxy_test.cpp index bdb07e20902..90f7191b674 100644 --- a/src/test/soundproxy_test.cpp +++ b/src/test/soundproxy_test.cpp @@ -1069,3 +1069,20 @@ TEST_F(SoundSourceProxyTest, fileSuffixWithDifferingType) { SoundSourceProxy::isFileSuffixSupported(fileSuffix)); } } + +TEST_F(SoundSourceProxyTest, freeModeGarbage) { + // Try to load a file with an insane bitrate in the garbage before the real frame. + QString filePath = getTestDir().filePath( + QStringLiteral("id3-test-data/free_mode_garbage.mp3")); + ASSERT_TRUE(SoundSourceProxy::isFileNameSupported(filePath)); + const auto fileUrl = QUrl::fromLocalFile(filePath); + const auto providerRegistrations = + SoundSourceProxy::allProviderRegistrationsForUrl(fileUrl); + for (const auto& providerRegistration : providerRegistrations) { + mixxx::AudioSourcePointer pContReadSource = openAudioSource( + filePath, + providerRegistration.getProvider()); + ASSERT_TRUE(pContReadSource != nullptr); + break; + } +}