mirror of
https://github.com/storytold/filmcraft.git
synced 2026-10-24 10:10:05 -06:00
security(mpegts): avoid repeated audio buffer drains (#2898)
This commit is contained in:
@@ -652,11 +652,14 @@ impl Splitter {
|
||||
match next {
|
||||
Some(d) => {
|
||||
self.skipped += d as u64;
|
||||
self.trim(self.buf.len() - (i + 1 + d));
|
||||
// Keep a cursor into the current window rather than draining its
|
||||
// prefix for every false sync candidate.
|
||||
self.next_frame = Some(at + 1 + d as u64);
|
||||
}
|
||||
None => {
|
||||
self.skipped += (self.buf.len() - i - 1) as u64;
|
||||
self.trim(0);
|
||||
// A split header can begin in the final few bytes; compact once.
|
||||
self.trim(7);
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user