Skip to content

Commit

Permalink
[rtc] *Fix Fua package bug(payload size minus one). (#2618)
Browse files Browse the repository at this point in the history
* This can cause webrtc video PacketBuffer assemble corrupt when (nal size - 1) % 1300 == 0
* issues about webrtc all caused by this bug
  • Loading branch information
zozobreakzou authored Sep 23, 2021
1 parent 6693c73 commit 46adcfb
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion trunk/src/app/srs_app_rtc_source.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 46adcfb

Please sign in to comment.