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

fixed IndexOfBytes bug #125

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

rokenbuzz
Copy link

ArrayUtils IndexOfBytes needs to move its startIndex back if a partially successful match ends up mismatching. Otherwise a match that starts within this attempted match will be missed.
I noticed this happen in H264Slicer.Slice. It missed a second nal unit start marker (0001) because the bytes contained 00001 which matched the start marker up to 000 and correctly gave up the match when the next 0 didn't match the needed 1. But then it continued without moving the start index back, so missed the 0001 match and returned -1.
My video still played regardless. The nal unit type was type 8 and I'm not sure what that impacts.
I added a test case to cover this.

Revan1985 pushed a commit to Revan1985/RtspClientSharp that referenced this pull request Nov 28, 2023
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.

None yet

1 participant