diff options
author | Andriy Gelman <andriy.gelman@gmail.com> | 2020-01-10 23:25:25 -0500 |
---|---|---|
committer | Michael Niedermayer <michael@niedermayer.cc> | 2020-01-21 15:56:39 +0100 |
commit | 1054b68a62e1ea963c0450430dd77f5fbf09a525 (patch) | |
tree | 40d960c47dfc6c79c4c97c8c6859515016975970 /libavformat/libzmq.c | |
parent | f2e78644962fa93edb0b1cf92397f99e772d92d6 (diff) | |
download | ffmpeg-1054b68a62e1ea963c0450430dd77f5fbf09a525.tar.gz |
avformat/libzmq: Check return of zmq_setsockopt
Signed-off-by: Andriy Gelman <andriy.gelman@gmail.com>
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavformat/libzmq.c')
-rw-r--r-- | libavformat/libzmq.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/libavformat/libzmq.c b/libavformat/libzmq.c index d86488293f..2df55542c7 100644 --- a/libavformat/libzmq.c +++ b/libavformat/libzmq.c @@ -123,7 +123,14 @@ static int zmq_proto_open(URLContext *h, const char *uri, int flags) return AVERROR_EXTERNAL; } - zmq_setsockopt(s->socket, ZMQ_SUBSCRIBE, "", 0); + ret = zmq_setsockopt(s->socket, ZMQ_SUBSCRIBE, "", 0); + if (ret == -1) { + av_log(h, AV_LOG_ERROR, "Error occured during zmq_setsockopt(): %s\n", ZMQ_STRERROR); + zmq_close(s->socket); + zmq_ctx_term(s->context); + return AVERROR_EXTERNAL; + } + ret = zmq_connect(s->socket, uri); if (ret == -1) { av_log(h, AV_LOG_ERROR, "Error occured during zmq_connect(): %s\n", ZMQ_STRERROR); |