Repository navigation
foxenflac, microflac and claxon exit 1 on an input that ends before its stream does - #91
Merged
Merged
Conversation
foxenflac and microflac exited 0 with an empty output on an input that ended before the stream info (a file that is not FLAC, a few bytes, a cut inside STREAMINFO), and claxon exited 0 with a short output on a stream cut at a frame boundary. `flac -d` exits 1 in each case, and each README promises 1 on any error. These libraries are fed bytes, or iterate to the end of them, and report nothing wrong: the program is the only place that knows. foxenflac and microflac now refuse an input whose stream info never came, and claxon holds its output to the frame count STREAMINFO declares, as drflac, foxenflac, microflac and cscoreflac already did. symphonia needs nothing: Symphonia reports "unexpected end of file" there itself. scripts/decoder-smoke.sh gains two rows for every program, neither of which may exit 0: the 16-bit stream cut to its first three bytes, and cut at a frame boundary. On darwin-arm64 the first fails on foxenflac before this change and the second on claxon. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Signed-off-by: closer-claudio <claudio@farcloser.world>
closer-claudio
enabled auto-merge
November 22, 2026 00:00
Contributor
Author
|
Reviewed at d8e4c83 |
apostasie
approved these changes
Nov 22, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
🎯 Why
Three of the FLAC decoder programs exited 0 on an input that ended early, where
flac -dexits 1 and each README promises "1 on any error":foxenflacandmicroflacwrote an empty output and exited 0 when the input ended before the stream info: a file that is not FLAC, a file of a few bytes, a cut inside STREAMINFO.claxonwrote a short output and exited 0 on a stream cut at a frame boundary.The libraries under them are fed bytes, or iterate to the end of them, and report nothing wrong there: the program is the only place that knows the input ended.
🛠️ What
foxenflac/main.c,microflac/main.cpp: exit 1 when the input ended and the stream info never came.claxon/src/main.rs: the output is held to the frame count STREAMINFO declares, asdrflac,foxenflac,microflacandcscoreflacalready did.symphoniais unchanged: Symphonia reports "unexpected end of file" there itself.scripts/decoder-smoke.sh: two rows for all six programs, neither of which may exit 0: the 16-bit stream cut to its first three bytes, and cut at a frame boundary. The second is the whole stream cut to the length of a stream of its first blocks; encoded without a seek table, the two differ in their stream info alone.🧪 How
On darwin-arm64, binaries built from
mainagainst binaries built from this head:foxenflac: before, the three-byte row fails (exit 0); after, every row passes.claxon: before, the frame-boundary row fails (exit 0); after, every row passes.symphonia: every row passes before and after.microflac,drflacandcscoreflacwere not run locally; the checks on this pull request run all six on every platform.📝 Notes
A consumer sees exit 1 where it saw exit 0 only on an input that is cut short or is not FLAC.