Skip to content

Improve FLAC channel count validation#927

Merged
sbooth merged 4 commits into
mainfrom
flac-channel-change
Jun 7, 2026
Merged

Improve FLAC channel count validation#927
sbooth merged 4 commits into
mainfrom
flac-channel-change

Conversation

@sbooth

@sbooth sbooth commented Jun 6, 2026

Copy link
Copy Markdown
Owner

No description provided.

Copilot AI review requested due to automatic review settings June 6, 2026 19:45

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cpp-linter Review

Used clang-format v22.1.7

Click here for the full clang-format patch
diff --git a/Sources/CSFBAudioEngine/Decoders/SFBFLACDecoder.mm b/Sources/CSFBAudioEngine/Decoders/SFBFLACDecoder.mm
index 2e370c6..c9cf23c 100644
--- a/Sources/CSFBAudioEngine/Decoders/SFBFLACDecoder.mm
+++ b/Sources/CSFBAudioEngine/Decoders/SFBFLACDecoder.mm
@@ -596,3 +596,4 @@ void errorCallback(const FLAC__StreamDecoder *decoder, FLAC__StreamDecoderErrorS
-                       unsupportedFormatError:NSLocalizedString(@"FLAC", @"")
-                       recoverySuggestion:NSLocalizedString(@"Channel count mismatch between STREAMINFO and first frame header.",
-                                                            @"")];
+                unsupportedFormatError:NSLocalizedString(@"FLAC", @"")
+                    recoverySuggestion:NSLocalizedString(
+                                               @"Channel count mismatch between STREAMINFO and first frame header.",
+                                               @"")];

Have any feedback or feature suggestions? Share it here.

Comment thread Sources/CSFBAudioEngine/Decoders/SFBFLACDecoder.mm Outdated

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR refines FLAC channel-count validation in SFBFLACDecoder by moving the STREAMINFO vs frame-header channel check to only trigger on the first decoded frame, aiming to avoid repeated per-frame validation while still catching invalid streams early.

Changes:

  • Removed per-frame STREAMINFO vs frame-header channel validation.
  • Added a STREAMINFO vs first frame-header channel validation with a more specific error message.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread Sources/CSFBAudioEngine/Decoders/SFBFLACDecoder.mm
@github-actions github-actions Bot dismissed their stale review June 6, 2026 19:48

outdated suggestion

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 1 out of 1 changed files in this pull request and generated no new comments.

@sbooth sbooth merged commit 8654f0c into main Jun 7, 2026
2 checks passed
@sbooth sbooth deleted the flac-channel-change branch June 7, 2026 04:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants