From b77de8f6f2d566db8c772e501b3e69b67b431c1c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Fri, 17 May 2024 11:13:19 +0300 Subject: [PATCH] dtlsconnection: Fix overflow in timeout calculation on systems with 32 bit time_t If a timeout of more than 4295s was scheduled, the calculation would overflow and a too short timeout would be used instead. Part-of: --- subprojects/gst-plugins-bad/ext/dtls/gstdtlsconnection.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subprojects/gst-plugins-bad/ext/dtls/gstdtlsconnection.c b/subprojects/gst-plugins-bad/ext/dtls/gstdtlsconnection.c index e94c6e7e9e..eaf77c34e6 100644 --- a/subprojects/gst-plugins-bad/ext/dtls/gstdtlsconnection.c +++ b/subprojects/gst-plugins-bad/ext/dtls/gstdtlsconnection.c @@ -449,7 +449,7 @@ gst_dtls_connection_check_timeout_locked (GstDtlsConnection * self) priv = self->priv; if (DTLSv1_get_timeout (priv->ssl, &timeout)) { - wait_time = timeout.tv_sec * G_USEC_PER_SEC + timeout.tv_usec; + wait_time = ((gint64) timeout.tv_sec) * G_USEC_PER_SEC + timeout.tv_usec; GST_DEBUG_OBJECT (self, "waiting for %" G_GINT64_FORMAT " usec", wait_time); if (wait_time) {