Skip to content

Commit

Permalink
[rtc] *Fix Fua package bug(payload size minus one). (ossrs#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 and peipeiguo committed May 18, 2022
1 parent 4fe423c commit ffd14c7
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 @@ -1183,7 +1183,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 ffd14c7

Please sign in to comment.