diff mbox series

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

Message ID 20210704154027.13380-3-andriy.gelman@gmail.com
State Accepted
Headers show
Series [FFmpeg-devel,v2,1/3] avformat/rtsp: Set port_off to zero for low min/max port range | expand

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 July 4, 2021, 3:40 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.

Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
---
 libavformat/rtsp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Martin Storsjö July 4, 2021, 7:51 p.m. UTC | #1
On Sun, 4 Jul 2021, Andriy Gelman wrote:

> From: Andriy Gelman <andriy.gelman@gmail.com>
>
> Currently it is only checked that the rtp port does not exceed rtp_port_max.
>
> Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
> ---
> libavformat/rtsp.c | 2 +-
> 1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c
> index bedb75c7bd..a3026f8b73 100644
> --- a/libavformat/rtsp.c
> +++ b/libavformat/rtsp.c
> @@ -1500,7 +1500,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,
> -- 
> 2.32.0

These three patches seem ok to me, assuming you've tested them.

// Martin
Andriy Gelman July 5, 2021, 5:35 p.m. UTC | #2
On Sun, 04. Jul 22:51, Martin Storsjö wrote:
> On Sun, 4 Jul 2021, Andriy Gelman wrote:
> 
> > From: Andriy Gelman <andriy.gelman@gmail.com>
> > 
> > Currently it is only checked that the rtp port does not exceed rtp_port_max.
> > 
> > Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
> > ---
> > libavformat/rtsp.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c
> > index bedb75c7bd..a3026f8b73 100644
> > --- a/libavformat/rtsp.c
> > +++ b/libavformat/rtsp.c
> > @@ -1500,7 +1500,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,
> > -- 
> > 2.32.0

> 
> These three patches seem ok to me, assuming you've tested them.
> 
> // Martin
> 

Thanks, will apply.
diff mbox series

Patch

diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c
index bedb75c7bd..a3026f8b73 100644
--- a/libavformat/rtsp.c
+++ b/libavformat/rtsp.c
@@ -1500,7 +1500,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,