rtpjitterbuffer: Avoid integer overflow in max saveable packets calculation with...
authorSebastian Dröge <sebastian@centricular.com>
Thu, 7 Sep 2023 14:23:37 +0000 (17:23 +0300)
committerTim-Philipp Müller <tim@centricular.com>
Tue, 12 Sep 2023 09:40:33 +0000 (10:40 +0100)
commit2bd21a6f4063072468d6d8e9153d073efcfbc705
tree2be79665d5adb95f661bf4b5992760150f9ae2d6
parentedf37b216fb2efd28e9cd3248144f1bbe9bf15f9
rtpjitterbuffer: Avoid integer overflow in max saveable packets calculation with negative offset

The timestamp offset can be negative, and it can be a bigger negative
number than the latency introduced by the rtpjitterbuffer so the overall
timeout offset can be negative.

Using the negative offset for calculating how many packets can still
arrive in time when encountering a lost packet in an equidistant stream
would then overflow and instead of considering fewer packets lost a lot
more packets are considered lost.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/5318>
subprojects/gst-plugins-good/gst/rtpmanager/gstrtpjitterbuffer.c