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

phunkyfish phunkyfish at gmail.com
Wed Sep 18 09:54:27 EEST 2019


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

diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c
index c153cac88b..3e8606dade 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 == NULL)
+        return ENOTCONN;
+
     /* Add in RTSP headers */
     out_buf = buf;
     rt->seq++;
-- 
2.20.1 (Apple Git-117)



More information about the ffmpeg-devel mailing list