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

Martin Storsjö martin at martin.st
Fri Nov 20 10:28:24 EET 2020


On Mon, 12 Oct 2020, Andriy Gelman wrote:

> 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

Oops, it looks like this was missing from the initial patch of this 
function, so LGTM, thanks!

// Martin



More information about the ffmpeg-devel mailing list