summaryrefslogtreecommitdiff
path: root/libavformat/rtsp.c
diff options
context:
space:
mode:
authorMartin Storsjö <martin@martin.st>2016-09-15 13:50:57 +0200
committerCarl Eugen Hoyos <cehoyos@ag.or.at>2016-09-15 13:50:57 +0200
commitf8a13c72132a65e34e05b878dc780ad330dd7371 (patch)
tree390b81318683a206d465facf9949b5a4ef6e1937 /libavformat/rtsp.c
parent96cd6f672e5d8c5d49b06de4f24376f36880fea8 (diff)
lavf/rtsp: Fix a crash with the RTSP muxer.
Introduced in 00e122bc / bc2a3296 The whole block that the statement was added to is only relevant when used as a demuxer, but the other statements there have had other if statements guarding them. Make sure to only run this whole block if being used as a demuxer. Fixes ticket #5844.
Diffstat (limited to 'libavformat/rtsp.c')
-rw-r--r--libavformat/rtsp.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libavformat/rtsp.c b/libavformat/rtsp.c
index 15e1ab8395..c6292c5543 100644
--- a/libavformat/rtsp.c
+++ b/libavformat/rtsp.c
@@ -834,7 +834,8 @@ int ff_rtsp_open_transport_ctx(AVFormatContext *s, RTSPStream *rtsp_st)
if (!rtsp_st->transport_priv) {
return AVERROR(ENOMEM);
- } else if (CONFIG_RTPDEC && rt->transport == RTSP_TRANSPORT_RTP) {
+ } else if (CONFIG_RTPDEC && rt->transport == RTSP_TRANSPORT_RTP &&
+ s->iformat) {
RTPDemuxContext *rtpctx = rtsp_st->transport_priv;
rtpctx->ssrc = rtsp_st->ssrc;
if (rtsp_st->dynamic_handler) {