1
0
Fork 0
mirror of https://github.com/ossrs/srs.git synced 2025-02-13 03:41:55 +00:00

[rtc] *Fix Fua package bug(payload size minus one). (#2618)

* This can cause webrtc video PacketBuffer assemble corrupt when (nal size - 1) % 1300 == 0
* issues about webrtc all caused by this bug
This commit is contained in:
zozobreakzou 2021-09-23 11:10:16 +08:00 committed by GitHub
parent 6693c73a4c
commit 46adcfb6c9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1192,7 +1192,7 @@ srs_error_t SrsRtcFromRtmpBridger::package_fu_a(SrsSharedPtrMessage* msg, SrsSam
uint8_t header = sample->bytes[0];
uint8_t nal_type = header & kNalTypeMask;
int num_of_packet = 1 + (sample->size - 1) / fu_payload_size;
int num_of_packet = 1 + (nb_left - 1) / fu_payload_size;
for (int i = 0; i < num_of_packet; ++i) {
int packet_size = srs_min(nb_left, fu_payload_size);