1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-03-09 15:49:59 +00:00

RTC: Fix parse error stap playload crash bug

This commit is contained in:
winlin 2021-01-05 10:56:05 +08:00
parent ebe38f7337
commit 155587d2c1
2 changed files with 60 additions and 0 deletions

View file

@ -994,6 +994,14 @@ srs_error_t SrsRtpSTAPPayload::decode(SrsBuffer* buf)
// STAP header, RTP payload format for aggregation packets
// @see https://tools.ietf.org/html/rfc6184#section-5.7
uint8_t v = buf->read_1bytes();
// forbidden_zero_bit shoul be zero.
// @see https://tools.ietf.org/html/rfc6184#section-5.3
uint8_t f = (v & 0x80);
if (f == 0x80) {
return srs_error_new(ERROR_RTC_RTP_MUXER, "forbidden_zero_bit should be zero");
}
nri = SrsAvcNaluType(v & (~kNalTypeMask));
// NALUs.