In ULP FEC fuzzer test, make sure sequence number is not the same as previous sequence number.
Bug: chromium:859265 Change-Id: I9acb9a177dfed3830ead0ba5a16ee4310f4d2b5b Reviewed-on: https://webrtc-review.googlesource.com/86547 Commit-Queue: Ying Wang <yinwa@webrtc.org> Reviewed-by: Henrik Lundin <henrik.lundin@webrtc.org> Cr-Commit-Position: refs/heads/master@{#23806}
This commit is contained in:
@ -162,6 +162,7 @@ webrtc_fuzzer_test("ulpfec_generator_fuzzer") {
|
||||
"ulpfec_generator_fuzzer.cc",
|
||||
]
|
||||
deps = [
|
||||
"../../modules:module_api_public",
|
||||
"../../modules/rtp_rtcp",
|
||||
"../../modules/rtp_rtcp:fec_test_helper",
|
||||
"../../modules/rtp_rtcp:rtp_rtcp_format",
|
||||
|
@ -10,6 +10,7 @@
|
||||
|
||||
#include <memory>
|
||||
|
||||
#include "modules/include/module_common_types_public.h"
|
||||
#include "modules/rtp_rtcp/source/byte_io.h"
|
||||
#include "modules/rtp_rtcp/source/fec_test_helper.h"
|
||||
#include "modules/rtp_rtcp/source/ulpfec_generator.h"
|
||||
@ -49,8 +50,8 @@ void FuzzOneInput(const uint8_t* data, size_t size) {
|
||||
// Check the sequence numbers are monotonic. In rare case the packets number
|
||||
// may loop around and in the same FEC-protected group the packet sequence
|
||||
// number became out of order.
|
||||
if (protect && static_cast<uint16_t>(seq_num - prev_seq_num) <
|
||||
kUlpfecMaxMediaPackets) {
|
||||
if (protect && IsNewerSequenceNumber(seq_num, prev_seq_num) &&
|
||||
seq_num < prev_seq_num + kUlpfecMaxMediaPackets) {
|
||||
generator.AddRtpPacketAndGenerateFec(packet.get(), payload_size,
|
||||
rtp_header_length);
|
||||
prev_seq_num = seq_num;
|
||||
|
Reference in New Issue
Block a user