mirror of
https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs.git
synced 2025-01-03 15:58:42 +00:00
rtpbin2: protoct against adding with overflow
If jitter is really bad, then this calculation may overflow. Protect against that. Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-rs/-/merge_requests/1605>
This commit is contained in:
parent
ba70bb1154
commit
260b04a1cf
1 changed files with 3 additions and 1 deletions
|
@ -734,7 +734,9 @@ impl RemoteSendSource {
|
|||
};
|
||||
self.transit = Some(transit);
|
||||
trace!("jitter {} diff {diff}", self.jitter);
|
||||
self.jitter += diff.saturating_sub((self.jitter.saturating_add(8)) >> 4);
|
||||
self.jitter = self
|
||||
.jitter
|
||||
.saturating_add(diff.saturating_sub((self.jitter.saturating_add(8)) >> 4));
|
||||
}
|
||||
self.source.payload_type = Some(payload_type);
|
||||
|
||||
|
|
Loading…
Reference in a new issue