[FFmpeg-cvslog] avformat/tcp: correct strdup check

Gyan Doshi git at videolan.org
Sun Apr 2 07:49:39 EEST 2023


ffmpeg | branch: master | Gyan Doshi <ffmpeg at gyani.pro> | Thu Mar 30 23:37:56 2023 +0530| [dd7e30724b739af9642917b1d04ba56d12e5e13f] | committer: Gyan Doshi

avformat/tcp: correct strdup check

Fixes CID 1524608.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=dd7e30724b739af9642917b1d04ba56d12e5e13f
---

 libavformat/tcp.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/tcp.c b/libavformat/tcp.c
index a889633457..db41394a84 100644
--- a/libavformat/tcp.c
+++ b/libavformat/tcp.c
@@ -169,7 +169,7 @@ static int tcp_open(URLContext *h, const char *uri, int flags)
         if (av_find_info_tag(buf, sizeof(buf), "local_port", p)) {
             av_freep(&s->local_port);
             s->local_port = av_strdup(buf);
-            if (!s->local_addr)
+            if (!s->local_port)
                 return AVERROR(ENOMEM);
         }
         if (av_find_info_tag(buf, sizeof(buf), "local_addr", p)) {



More information about the ffmpeg-cvslog mailing list