aboutsummaryrefslogtreecommitdiff
path: root/cast/streaming/sender_packet_router.cc
diff options
context:
space:
mode:
Diffstat (limited to 'cast/streaming/sender_packet_router.cc')
-rw-r--r--cast/streaming/sender_packet_router.cc5
1 files changed, 3 insertions, 2 deletions
diff --git a/cast/streaming/sender_packet_router.cc b/cast/streaming/sender_packet_router.cc
index c2b23dbf..684b1fb2 100644
--- a/cast/streaming/sender_packet_router.cc
+++ b/cast/streaming/sender_packet_router.cc
@@ -102,10 +102,11 @@ void SenderPacketRouter::OnReceivedPacket(const IPEndpoint& source,
InspectPacketForRouting(packet);
if (seems_like.first != ApparentPacketType::RTCP) {
constexpr int kMaxPartiaHexDumpSize = 96;
+ const std::size_t encode_size =
+ std::min(packet.size(), static_cast<size_t>(kMaxPartiaHexDumpSize));
OSP_LOG_WARN << "UNKNOWN packet of " << packet.size()
<< " bytes. Partial hex dump: "
- << HexEncode(absl::Span<const uint8_t>(packet).subspan(
- 0, kMaxPartiaHexDumpSize));
+ << HexEncode(packet.data(), encode_size);
return;
}
const auto it = FindEntry(seems_like.second);