GeezerVisonThe World Wide Web, restored to 800 pixels of glory. | ||||||||||||||||
| Home|About|Gaming cabinet|Archives|How it works|Starter sites | ||||||||||||||||
GeezerVison is showing github.com — audio: validate arguments before narrowing them, and end an MP3 with … by peterbay · Pull Request #11368 · adafruit/circuitpython ConversationCode written by Claude Code, guided and corrected by @peterbay. The problemFive defects across the audio modules. Four are arguments narrowed into a The changes
TestingSeeed XIAO nRF52840 Sense with an Adafruit Audio BFF, on two builds differing only by these changes. Playback ran through a mixer voice held at level 0, so the decoder was driven without anything audible.
Two of these are not covered above. The mixer's one-word overrun needs an odd
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions…DONE audiomixer narrowed the voice index into a uint8_t before comparing it with voice_count, so voice=256 became 0 and played on the first voice. PDMIn did the same with bit_depth and oversample, ahead of the divisibility check that 256 then passed as zero, and never checked sample_rate. The sample_rate setter shared by every audiosample validated nothing at all, so it could undo the constructors' own check. I2SOut's left_justified was declared MP_ARG_OBJ and read as .u_bool, so passing it explicitly gave whatever the object pointer aliased to. audiomixer's mono path stepped two samples at a time and wrote word_buffer[i] and word_buffer[i + 1], one past the end for an odd n. An input underflow at the end of the data is how an MP3 cut off mid-frame ends, not a failure, but get_buffer returned GET_BUFFER_ERROR for it and a looped playback stopped instead of restarting. It returns GET_BUFFER_DONE for an underflow at end of file now. stream_lseek was also given its offset and whence the wrong way round in two places, and the success test compared against zero where a stream that cannot seek returns its unchanged position.
dhalbert
approved these changes
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks - these are nice fixes, and they all make sense to me.
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. All reactions
Author
All reactions
Sorry, something went wrong. Uh oh!
There was an error while loading. Please reload this page. Uh oh!
There was an error while loading. Please reload this page.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
ReviewersUh oh!
There was an error while loading. Please reload this page. AssigneesNo one assignedLabels
None yet
ProjectsMilestoneNo milestoneDevelopmentSuccessfully merging this pull request may close these issues. Uh oh!
There was an error while loading. Please reload this page. 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. | ||||||||||||||||
| You are visitor 01402503 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |