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

[Bug]: Possible bug in ByteBufferExtensions #158

Open
tukez opened this issue Aug 12, 2024 · 3 comments
Open

[Bug]: Possible bug in ByteBufferExtensions #158

tukez opened this issue Aug 12, 2024 · 3 comments
Labels
bug Something isn't working

Comments

@tukez
Copy link
Contributor

tukez commented Aug 12, 2024

Version

2.6.1

Environment that reproduces the issue

No devices.

RTMP/SRT/... Server

No server.

Audio configuration

No response

Video configuration

No response

Is it reproducible in the demos application?

Yes

Reproduction steps

byteBuffer.toByteArray()

Expected result

ByteBuffer.toByteArray() has two implementations, one for array backed buffers and one for others. The array backed implementation does not move the ByteBuffer position whereas the other implementation does.

Noticed this while reading the source code, a possible source of bugs.

Actual result

Implementation works the same for all ByteBuffers.

Additional context

No response

Relevant logs output

No response

@tukez tukez added the bug Something isn't working label Aug 12, 2024
@ThibaultBee
Copy link
Owner

Indeed.
Just moving the position to the limit would do it.

StreamPack does not use the ByteBuffer once they have been read by toByteArray()

@ThibaultBee
Copy link
Owner

Could you have a look at #162?

@tukez
Copy link
Contributor Author

tukez commented Aug 30, 2024

Looks correct.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants