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

Michael Niedermayer michael at niedermayer.cc
Fri Sep 20 15:02:44 EEST 2019


On Wed, Sep 18, 2019 at 09:42:14PM +0100, phunkyfish wrote:
> ---
>  libavformat/rtsp.c | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c
> index c153cac88b..5e8adfaf3c 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 && !rt->rtsp_hd_out)
> +        return ENOTCONN;
> +
>      /* Add in RTSP headers */
>      out_buf = buf;
>      rt->seq++;


if (rt && ...
implies that rt can be NULL

rt->seq++; implies rt is not NULL


[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Complexity theory is the science of finding the exact solution to an
approximation. Benchmarking OTOH is finding an approximation of the exact
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20190920/09ed3eb1/attachment.sig>


More information about the ffmpeg-devel mailing list