diff mbox series

[FFmpeg-devel,3/3] avformat/rtsp: Include rtcp in port range check

Message ID 20210404153645.565251-3-andriy.gelman@gmail.com
State New
Headers show
Series [FFmpeg-devel,1/3] avformat/rtsp: Fix floating point exception for low min/max port range
Related show

Checks

Context Check Description
andriy/x86_make success Make finished
andriy/x86_make_fate success Make fate finished
andriy/PPC64_make success Make finished
andriy/PPC64_make_fate success Make fate finished

Commit Message

Andriy Gelman April 4, 2021, 3:36 p.m. UTC
From: Andriy Gelman <andriy.gelman@gmail.com>

Currently it is only checked that the rtp port does not exceed rtp_port_max.
---
 libavformat/rtsp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c
index 6438e2edb8..e6a068148b 100644
--- a/libavformat/rtsp.c
+++ b/libavformat/rtsp.c
@@ -1508,7 +1508,7 @@  int ff_rtsp_make_setup_request(AVFormatContext *s, const char *host, int port,
             }
 
             /* first try in specified port range */
-            while (j <= rt->rtp_port_max) {
+            while (j + 1 <= rt->rtp_port_max) {
                 AVDictionary *opts = map_to_opts(rt);
 
                 ff_url_join(buf, sizeof(buf), "rtp", NULL, host, -1,