Skip to content

Commit c7348d0

Browse files
committed
H265RtpDepacketizer: Handle empty RTP packet payloads
Similar to the fix for the H.264 RTP depacketizer in https://github.com/ paullouisageneau/pull/1140.
1 parent d535037 commit c7348d0

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/h265rtpdepacketizer.cpp

+11
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,17 @@ message_vector H265RtpDepacketizer::buildFrames(message_vector::iterator begin,
3232
auto pkt = it->get();
3333
auto pktParsed = reinterpret_cast<const rtc::RtpHeader *>(pkt->data());
3434
auto rtpHeaderSize = pktParsed->getSize() + pktParsed->getExtensionHeaderSize();
35+
auto rtpPaddingSize = 0;
36+
37+
if (pktParsed->padding()) {
38+
rtpPaddingSize = std::to_integer<uint8_t>(pkt->at(pkt->size() - 1));
39+
}
40+
41+
if (pkt->size() == rtpHeaderSize + rtpPaddingSize) {
42+
PLOG_VERBOSE << "H.265 RTP packet has empty payload";
43+
continue;
44+
}
45+
3546
auto nalUnitHeader =
3647
H265NalUnitHeader{std::to_integer<uint8_t>(pkt->at(rtpHeaderSize)),
3748
std::to_integer<uint8_t>(pkt->at(rtpHeaderSize + 1))};

0 commit comments

Comments
 (0)