ogg_pager: Fix panic on nil packet #547
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I had a pretty weird crash that gets caused by the old
assert!(packet.is_empty());
assertion. At the assertion point, I had the following state:packet.len() = 3908
ctx = { ... abgp: 0, stream_serial: 0, header_flags: 2, flags: PaginateContextFlags { first_page: false, fresh_packet: true, packet_finished_on_page: false, need_nil_page: true }, pos: 0, idx: 24, remaining_page_size: 8160, current_packet_len: 3908, last_segment_size: Some(83)
This PR seems to fix it, but I'm unfamiliar with all the inner workings of ogg, so please let me know if there's something I should fix.