document VP9 frame payload requirement

This commit is contained in:
YuLi
2026-07-30 21:46:49 -07:00
parent 394fa8387b
commit 9fa131d71b
2 changed files with 15 additions and 9 deletions

View File

@@ -208,6 +208,8 @@ int RTPPayloadVP9::parse(const unsigned char *data, int dataLength) {
}
}
}
// Downstream VP9 frame inspection reads the first frame-data byte, so a
// payload descriptor without any frame data must not enter the frame path.
if (remaining == 0) return -1;
return dataPtr - data;
}
@@ -245,6 +247,8 @@ bool VP9RtpDecoder::decodeRtp(const RtpPacket::Ptr &rtp) {
RTPPayloadVP9 info;
int offset = info.parse(payload, payload_size);
// Keep this independent of the parser's internal checks: a successful
// descriptor must still leave at least one byte of VP9 frame payload.
if (offset < 0 || static_cast<size_t>(offset) >= payload_size) {
WarnL << "VP9 RTP payload parse failed, seq:" << seq;
_frame_drop = true;