[FFmpeg-devel] [PATCH v3 5/6] avformat/rtsp: set return variable in error path

Andriy Gelman andriy.gelman at gmail.com
Mon Oct 12 23:36:08 EEST 2020


From: Andriy Gelman <andriy.gelman at gmail.com>

In this error path ret still stores the number of bytes read in
ffurl_read().

Signed-off-by: Andriy Gelman <andriy.gelman at gmail.com>
---
 libavformat/rtsp.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c
index e9fca034b4..cb9fc31166 100644
--- a/libavformat/rtsp.c
+++ b/libavformat/rtsp.c
@@ -2503,6 +2503,7 @@ static int rtp_read_header(AVFormatContext *s)
         av_log(s, AV_LOG_ERROR, "Unable to receive RTP payload type %d "
                                 "without an SDP file describing it\n",
                                  payload_type);
+        ret = AVERROR_INVALIDDATA;
         goto fail;
     }
     if (par->codec_type != AVMEDIA_TYPE_DATA) {
-- 
2.28.0



More information about the ffmpeg-devel mailing list