[FFmpeg-devel] [PATCH 2/2] avformat/rtsp: break on unknown protocols

Michael Niedermayer michael at niedermayer.cc
Fri May 20 02:43:12 EEST 2022


This function needs more cleanup and it lacks error handling

Fixes: use of uninitialized memory
Fixes: CID700776

Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>
---
 libavformat/rtsp.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c
index 88e9ef5226..f948f1d395 100644
--- a/libavformat/rtsp.c
+++ b/libavformat/rtsp.c
@@ -949,6 +949,8 @@ static void rtsp_parse_transport(AVFormatContext *s,
                              ";,", &p);
             }
             th->transport = RTSP_TRANSPORT_RAW;
+        } else {
+            break;
         }
         if (!av_strcasecmp(lower_transport, "TCP"))
             th->lower_transport = RTSP_LOWER_TRANSPORT_TCP;
-- 
2.17.1



More information about the ffmpeg-devel mailing list