Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adpcm: report unsupported error for more than 2 channels #345

Merged
merged 1 commit into from
Jan 18, 2025

Conversation

sscobici
Copy link

fixes panic

@@ -140,7 +140,7 @@ impl AdpcmDecoder {
decode_stereo(&mut stream, buffers, frames_per_block)?;
}
}
_ => unreachable!(),
_ => return unsupported_error("adpcm: up to two channels are supported"),
Copy link
Owner

Choose a reason for hiding this comment

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

This isn't the correct place to return an unsupported error, especially since the channel count is constant after instantiation.

Please move this validation check to try_new before we create the audio buffer with > 2 channels (line 91 seems good).

@sscobici
Copy link
Author

fixed.

@pdeljanov pdeljanov merged commit 54ab945 into pdeljanov:dev-0.6 Jan 18, 2025
11 checks passed
@pdeljanov
Copy link
Owner

Thanks again!

@sscobici sscobici deleted the adpcm-fix branch January 18, 2025 19: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