In PacketBuffer do not attempt to clear before 1st packet
ClearTo logic relies on clear to sequence number follows first_seq_num_ Bug: chromium:370689424 Change-Id: I12874d5ce7adfdcf9c0691acacdd2b8ae41ce307 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/371320 Commit-Queue: Danil Chapovalov <danilchap@webrtc.org> Reviewed-by: Rasmus Brandt <brandtr@webrtc.org> Cr-Commit-Position: refs/heads/main@{#43558}
This commit is contained in:
parent
2bee7845d3
commit
29a3f928f9
@ -129,8 +129,7 @@ PacketBuffer::InsertResult PacketBuffer::InsertPacket(
|
||||
|
||||
void PacketBuffer::ClearTo(uint16_t seq_num) {
|
||||
// We have already cleared past this sequence number, no need to do anything.
|
||||
if (is_cleared_to_first_seq_num_ &&
|
||||
AheadOf<uint16_t>(first_seq_num_, seq_num)) {
|
||||
if (AheadOf<uint16_t>(first_seq_num_, seq_num)) {
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
@ -839,6 +839,13 @@ TEST_F(PacketBufferH264FrameGap,
|
||||
SizeIs(2));
|
||||
}
|
||||
|
||||
TEST_F(PacketBufferH264FrameGap, DoesntCrashWhenTryToClearBefore1stPacket) {
|
||||
// Test scenario copied from the https://issues.chromium.org/370689424
|
||||
InsertH264(41087, kKeyFrame, kNotFirst, kNotLast, 123, 0, 0, false);
|
||||
packet_buffer_.ClearTo(30896);
|
||||
InsertH264(32896, kKeyFrame, kFirst, kLast, 123, 0, 0, false);
|
||||
}
|
||||
|
||||
} // namespace
|
||||
} // namespace video_coding
|
||||
} // namespace webrtc
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user