Oboe: input copy is bounded after the copy, not before

Open
#3,958 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
3/5
Estimated time
1-2 days
Newbie friendliness
76/100
Issue type
Bug
Clarity
Clearly specified
Activity status
Active
Tech stack
cpp

Research direction

Start in src/sound/oboe/sound.cpp at CSound::onAudioInput and read Init around the cited buffer sizing. Trace the requested and received frame counts through the callback, especially the copy and following comparison. Done means an oversized numFrames cannot write beyond vecsTmpInputAudioSndCrdStereo and the existing mismatch handling remains appropriate.

Written by the indexing model from the issue text.

Description

🤖 AI: CSound::onAudioInput copies the driver's buffer into a fixed-size vector, then compares the frame count it was handed with the one it asked for.

The copy writes numFrames * getChannelCount() samples into vecsTmpInputAudioSndCrdStereo, which Init sizes once to iOboeBufferSizeStereo. The comparison that would catch numFrames exceeding iOboeBufferSizeMono sits on the next line and only logs.

The resize above it is not a bound: it runs only while mCountCallbacksToDrain is above zero — the discard period right after start — and it sizes from getBytesPerFrame() rather than from a sample count. Once the drain ends, nothing resizes and nothing checks before the copy.

It has not been seen firing. Thirteen stream transitions on a Galaxy S22 produced no mismatch log, so Oboe honoured the requested size throughout that run. What is missing is anything that makes it so.

Raised as asked on #3873, after re-measuring all five findings on current main: three did not survive as written, one belongs to #3798, and this is the remainder.


🤖 This message was written by AI and reviewed by @mcfnord.

Dominant language
C
Stars
1.1k
Forks
248
Avg merge
1d 23h
Merged PRs (30d)
7

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from jamulussoftware/jamulus

All issues in jamulussoftware/jamulus

Similar issues

More C issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.