summaryrefslogtreecommitdiff
path: root/gst
diff options
context:
space:
mode:
authorTulio Beloqui <tulio.beloqui@pexip.com>2020-12-16 16:16:09 +0100
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>2021-08-25 08:36:06 +0000
commitabf4b57a1c23da969f2bb6749e6c7cf9f4694be4 (patch)
treec6fb73dcd996d97342432d591ac4b1362153b6a3 /gst
parentbe5fab15e00162a3cb0eb6f84e3bfdecb01c8869 (diff)
downloadgstreamer-plugins-good-abf4b57a1c23da969f2bb6749e6c7cf9f4694be4.tar.gz
rtptwcc: fixed guint8 overflow of feedback packet count
Co-authored-by: Havard Graff <havard.graff@gmail.com> Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-good/-/merge_requests/927>
Diffstat (limited to 'gst')
-rw-r--r--gst/rtpmanager/rtptwcc.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/gst/rtpmanager/rtptwcc.c b/gst/rtpmanager/rtptwcc.c
index d5039d4fc..eab88fc51 100644
--- a/gst/rtpmanager/rtptwcc.c
+++ b/gst/rtpmanager/rtptwcc.c
@@ -779,6 +779,7 @@ _check_for_lost_packets (RTPTWCCManager * twcc, GArray * twcc_packets,
guint16 base_seqnum, guint16 packet_count, guint8 fb_pkt_count)
{
guint packets_lost;
+ gint8 fb_pkt_count_diff;
guint i;
/* first packet */
@@ -787,9 +788,12 @@ _check_for_lost_packets (RTPTWCCManager * twcc, GArray * twcc_packets,
goto done;
}
+ fb_pkt_count_diff =
+ (gint8) (fb_pkt_count - twcc->expected_parsed_fb_pkt_count);
+
/* we have gone backwards, don't reset the expectations,
but process the packet nonetheless */
- if (fb_pkt_count < twcc->expected_parsed_fb_pkt_count) {
+ if (fb_pkt_count_diff < 0) {
GST_WARNING ("feedback packet count going backwards (%u < %u)",
fb_pkt_count, twcc->expected_parsed_fb_pkt_count);
return;
@@ -797,7 +801,7 @@ _check_for_lost_packets (RTPTWCCManager * twcc, GArray * twcc_packets,
/* we have jumped forwards, reset expectations, but don't trigger
lost packets in case the missing fb-packet(s) arrive later */
- if (fb_pkt_count > twcc->expected_parsed_fb_pkt_count) {
+ if (fb_pkt_count_diff > 0) {
GST_WARNING ("feedback packet count jumped ahead (%u > %u)",
fb_pkt_count, twcc->expected_parsed_fb_pkt_count);
goto done;