[FFmpeg-devel] [PATCH] avformat/rtsp: Fix dereference after null check

Michael Niedermayer michaelni at gmx.at
Sat Apr 11 00:50:25 CEST 2015


On Fri, Apr 10, 2015 at 07:25:48PM +0530, Himangi Saraogi wrote:
> ---
> This fixes CID 732219.
> 
>  libavformat/rtsp.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c
> index 42dbe96..251fdda 100644
> --- a/libavformat/rtsp.c
> +++ b/libavformat/rtsp.c
> @@ -802,7 +802,7 @@ int ff_rtsp_open_transport_ctx(AVFormatContext *s, RTSPStream *rtsp_st)
>      if (!st)
>          s->ctx_flags |= AVFMTCTX_NOHEADER;
>  
> -    if (CONFIG_RTSP_MUXER && s->oformat) {
> +    if (st && CONFIG_RTSP_MUXER && s->oformat) {

the CONFIG_* should stay the first element checked, some compilers
have problems optimizing ifs out when the first element is not 0 but a
subsequent one is

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

Old school: Use the lowest level language in which you can solve the problem
            conveniently.
New school: Use the highest level language in which the latest supercomputer
            can solve the problem without the user falling asleep waiting.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 181 bytes
Desc: Digital signature
URL: <https://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20150411/69bb0d1f/attachment.asc>


More information about the ffmpeg-devel mailing list