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

Potential issue #17

Open
grill2010 opened this issue Apr 11, 2022 · 0 comments
Open

Potential issue #17

grill2010 opened this issue Apr 11, 2022 · 0 comments

Comments

@grill2010
Copy link

Hi, I use the library in my streaming app and I encountered a potential issue, at some point very rarely my app was crashing so I started to investigating this problem and I found out it crashes here

https://github.com/Dario-Gasquez/swift-opus/blob/b763c399014eb6260a9bfe2f843677a4b4fd435b/Sources/Opus/Opus.Decoder.swift#L59

because the output variable was 'none' and the reason is that sample count returned 0 before ->

let sampleCount = opus_decoder_get_nb_samples(decoder, input.baseAddress!, Int32($0.count))

There was a pull request which added a check for this

#9 (review)

But this check should it not rather be

if sampleCount < 1 {
     throw Opus.Error(sampleCount)
}

as otherwise there will be a crash?

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

No branches or pull requests

1 participant