Skip to content

Conversation

@roderickvd
Copy link
Member

@roderickvd roderickvd commented Jan 14, 2026

Clarify Source::current_span_len() returns total span length (not remaining), while size_hint() returns remaining samples of the entire iterator. Fix multiple bugs in span boundary detection, seeking, and iterator implementations.

Opportunistic fixes:

  • fix division by zero, off-by-one error, and zero case handling
  • prevent counter overflows
  • optimize vector allocations

Mid-span seeking: best-effort tracking after try_seek() to detect span boundaries when seeking lands mid-span.

Fixes #691

Clarify Source::current_span_len() returns total span length (not remaining),
while size_hint() returns remaining samples. Fix multiple bugs in span boundary
detection, seeking, and iterator implementations.

Opportunistic fixes:
- fix division by zero, off-by-one error, and zero case handling
- prevent counter overflows
- optimize vector allocations

Mid-span seeking: best-effort tracking after try_seek() to detect span boundaries
when seeking lands mid-span.

Fixes #691
@roderickvd roderickvd requested a review from yara-blue January 14, 2026 23:11
@roderickvd
Copy link
Member Author

I did not fix the decoders because I had already done so with the infamous #786.

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.

Seek breaks span

2 participants