avformat/tls_openssl: Don't call functions inside FFMIN

It may call the function multiple times.

Reviewed-by: Timo Rothenpieler <timo@rothenpieler.org>
Reviewed-by: Steven Liu <lingjiujianke@gmail.com>
Signed-off-by: Andreas Rheinhardt <andreas.rheinhardt@outlook.com>
This commit is contained in:
Andreas Rheinhardt 2025-09-22 15:34:30 +02:00
parent ced4a6ebc9
commit db6cd6c6bf

View file

@ -939,8 +939,10 @@ static int tls_write(URLContext *h, const uint8_t *buf, int size)
uc->flags &= ~AVIO_FLAG_NONBLOCK;
uc->flags |= h->flags & AVIO_FLAG_NONBLOCK;
if (s->is_dtls)
size = FFMIN(size, DTLS_get_data_mtu(c->ssl));
if (s->is_dtls) {
const size_t mtu_size = DTLS_get_data_mtu(c->ssl);
size = FFMIN(size, mtu_size);
}
ret = SSL_write(c->ssl, buf, size);
if (ret > 0)