Avoid wrong parsing of padding length and its use in NetEq simulation.

Bug: b/113648474, webrtc:9730
Change-Id: Ieff7ab8697f5c8742548897a9b452a20b0bd2e7c
Reviewed-on: https://webrtc-review.googlesource.com/98461
Commit-Queue: Minyue Li <minyue@webrtc.org>
Reviewed-by: Henrik Lundin <henrik.lundin@webrtc.org>
Reviewed-by: Björn Terelius <terelius@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#24703}
This commit is contained in:
Minyue Li
2018-09-12 12:52:48 +02:00
committed by Commit Bot
parent fd5fbd0b58
commit 1a80018a3c
6 changed files with 114 additions and 25 deletions

View File

@ -42,7 +42,15 @@ absl::optional<int64_t> NetEqReplacementInput::NextOutputEventTime() const {
std::unique_ptr<NetEqInput::PacketData> NetEqReplacementInput::PopPacket() {
std::unique_ptr<PacketData> to_return = std::move(packet_);
packet_ = source_->PopPacket();
while (true) {
packet_ = source_->PopPacket();
if (!packet_)
break;
if (packet_->payload.size() > packet_->header.paddingLength) {
// Not padding only. Good to go. Skip this packet otherwise.
break;
}
}
ReplacePacket();
return to_return;
}