[FFmpeg-cvslog] libavformat/rtsp: return error if rtsp_hd_out is null instead of crash

Ross Nicholson git at videolan.org
Tue Dec 3 02:41:56 EET 2019


ffmpeg | branch: release/4.2 | Ross Nicholson <phunkyfish at gmail.com> | Thu Sep 19 16:12:33 2019 +0100| [289838b7bd207110d832ef248e4a3f6a001f372e] | committer: Aman Gupta

libavformat/rtsp: return error if rtsp_hd_out is null instead of crash

Signed-off-by: Aman Gupta <aman at tmm1.net>
(cherry picked from commit 460f74495fa93c4bb85503c5443580e2bb857efa)

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

 libavformat/rtsp.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c
index c153cac88b..859defa592 100644
--- a/libavformat/rtsp.c
+++ b/libavformat/rtsp.c
@@ -1318,6 +1318,9 @@ static int rtsp_send_cmd_with_content_async(AVFormatContext *s,
     char buf[4096], *out_buf;
     char base64buf[AV_BASE64_SIZE(sizeof(buf))];
 
+    if (!rt->rtsp_hd_out)
+        return ENOTCONN;
+
     /* Add in RTSP headers */
     out_buf = buf;
     rt->seq++;



More information about the ffmpeg-cvslog mailing list