Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel
 help / color / mirror / Atom feed
* [FFmpeg-devel] [PATCH 1/4] lavf/udp: do not return an uninitialized value from udp_open()
@ 2022-01-10 16:51 Anton Khirnov
  2022-01-10 16:51 ` [FFmpeg-devel] [PATCH 2/4] lavf/udp: log net errors to proper contexts rather than NULL Anton Khirnov
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: Anton Khirnov @ 2022-01-10 16:51 UTC (permalink / raw)
  To: ffmpeg-devel

---
 libavformat/udp.c | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/libavformat/udp.c b/libavformat/udp.c
index b8b0e19609..180d96a988 100644
--- a/libavformat/udp.c
+++ b/libavformat/udp.c
@@ -739,8 +739,10 @@ static int udp_open(URLContext *h, const char *uri, int flags)
     /* XXX: fix av_url_split */
     if (hostname[0] == '\0' || hostname[0] == '?') {
         /* only accepts null hostname if input */
-        if (!(flags & AVIO_FLAG_READ))
+        if (!(flags & AVIO_FLAG_READ)) {
+            ret = AVERROR(EINVAL);
             goto fail;
+        }
     } else {
         if ((ret = ff_udp_set_remote_url(h, uri)) < 0)
             goto fail;
@@ -750,8 +752,10 @@ static int udp_open(URLContext *h, const char *uri, int flags)
         s->local_port = port;
 
     udp_fd = udp_socket_create(h, &my_addr, &len, s->localaddr);
-    if (udp_fd < 0)
+    if (udp_fd < 0) {
+        ret = AVERROR(EIO);
         goto fail;
+    }
 
     s->local_addr_storage=my_addr; //store for future multicast join
 
-- 
2.33.0

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

To unsubscribe, visit link above, or email
ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-01-10 17:52 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-10 16:51 [FFmpeg-devel] [PATCH 1/4] lavf/udp: do not return an uninitialized value from udp_open() Anton Khirnov
2022-01-10 16:51 ` [FFmpeg-devel] [PATCH 2/4] lavf/udp: log net errors to proper contexts rather than NULL Anton Khirnov
2022-01-10 16:51 ` [FFmpeg-devel] [PATCH 3/4] lavf/network: log ff_socket() " Anton Khirnov
2022-01-10 16:51 ` [FFmpeg-devel] [PATCH 4/4] lavf/network: log ff_listen() " Anton Khirnov
2022-01-10 17:51 ` [FFmpeg-devel] [PATCH 1/4] lavf/udp: do not return an uninitialized value from udp_open() James Almer

Git Inbox Mirror of the ffmpeg-devel mailing list - see https://ffmpeg.org/mailman/listinfo/ffmpeg-devel

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://master.gitmailbox.com/ffmpegdev/0 ffmpegdev/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 ffmpegdev ffmpegdev/ https://master.gitmailbox.com/ffmpegdev \
		ffmpegdev@gitmailbox.com
	public-inbox-index ffmpegdev

Example config snippet for mirrors.


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git