Skip to content

Improve OMNI input validation - #4541

Open
michalkulakowski wants to merge 3 commits into
mainfrom
mkulakow/improve_omni_input_validation
Open

Improve OMNI input validation#4541
michalkulakowski wants to merge 3 commits into
mainfrom
mkulakow/improve_omni_input_validation

Conversation

@michalkulakowski

Copy link
Copy Markdown
Collaborator

🛠 Summary

JIRA/Issue if applicable.
Describe the changes.

🧪 Checklist

  • Unit tests added.
  • The documentation updated.
  • Change follows security best practices.
    ``

Copilot AI lite review requested due to automatic review settings September 11, 2026 12:56

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.

🟡 Changes recommended

Update the test to expect 16 frames and 64 bytes, or use a 16 kHz input.

Once you've addressed the issues Copilot identified, you can request another Copilot review.

Pull request overview

Improves OMNI WAV input validation by enforcing decoded-size limits, including when resampling is disabled.

Changes:

  • Adds overflow and maximum decoded-size checks.
  • Adds no-resampling WAV boundary tests.
File summaries
File Summary
src/audio/audio_utils.cpp Adds decoded buffer size validation before allocation.
src/test/audio/audio_utils_test.cpp Adds no-resampling size-limit tests; one expectation currently fails.
Review details
  • Files reviewed: 2/2 changed files
  • Comments generated: 1
  • Review effort level: Lite

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

Comment thread src/test/audio/audio_utils_test.cpp Outdated
Comment on lines +175 to +179
size_t expectedDecodedSize = static_cast<size_t>(8 * sizeof(float));
SetEnvironmentVar("OVMS_AUDIO_MAX_FILE_SIZE_BYTES", std::to_string(expectedDecodedSize));
std::vector<float> decoded;
EXPECT_NO_THROW({ decoded = readWithoutResample(view, "wav"); });
EXPECT_EQ(decoded.size(), 8u);
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