Skip to content

Commit

Permalink
In ULP FEC fuzzer test, make sure sequence number is not the same as …
Browse files Browse the repository at this point in the history
…previous sequence number.

Bug: chromium:859265
Change-Id: I9acb9a177dfed3830ead0ba5a16ee4310f4d2b5b
Reviewed-on: https://webrtc-review.googlesource.com/86547
Commit-Queue: Ying Wang <[email protected]>
Reviewed-by: Henrik Lundin <[email protected]>
Cr-Commit-Position: refs/heads/master@{#23806}
  • Loading branch information
yingwang authored and Commit Bot committed Jul 2, 2018
1 parent 4d01146 commit 6b33e60
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
1 change: 1 addition & 0 deletions test/fuzzers/BUILD.gn
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
5 changes: 3 additions & 2 deletions test/fuzzers/ulpfec_generator_fuzzer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 6b33e60

Please sign in to comment.