diff options
author | Himangi Saraogi <himangi774@gmail.com> | 2015-04-13 01:05:52 +0530 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2015-04-12 23:31:55 +0200 |
commit | f03dfe118b6426a2348d4f8db2daa9cd506b34fb (patch) | |
tree | c6e66a9d9e52ffdb22eb1a79a9dac31d193b23a0 | |
parent | ff50b1b13be965c93a9a7169edb62631a928e308 (diff) | |
download | ffmpeg-f03dfe118b6426a2348d4f8db2daa9cd506b34fb.tar.gz |
avformat/rtsp: Fix dereference after null check
This fixes CID 732219
Reviewed-by: Thomas Volkert <silvo@gmx.net>
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
-rw-r--r-- | libavformat/rtsp.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c index 42dbe96313..c186b998fc 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 (CONFIG_RTSP_MUXER && s->oformat && st) { int ret = ff_rtp_chain_mux_open((AVFormatContext **)&rtsp_st->transport_priv, s, st, rtsp_st->rtp_handle, RTSP_TCP_MAX_PACKET_SIZE, @@ -814,7 +814,7 @@ int ff_rtsp_open_transport_ctx(AVFormatContext *s, RTSPStream *rtsp_st) st->time_base = ((AVFormatContext*)rtsp_st->transport_priv)->streams[0]->time_base; } else if (rt->transport == RTSP_TRANSPORT_RAW) { return 0; // Don't need to open any parser here - } else if (CONFIG_RTPDEC && rt->transport == RTSP_TRANSPORT_RDT) + } else if (CONFIG_RTPDEC && rt->transport == RTSP_TRANSPORT_RDT && st) rtsp_st->transport_priv = ff_rdt_parse_open(s, st->index, rtsp_st->dynamic_protocol_context, rtsp_st->dynamic_handler); |