]> git.sesse.net Git - ffmpeg/commitdiff
lavf/rtsp: Fix a crash with the RTSP muxer.
authorMartin Storsjö <martin@martin.st>
Thu, 15 Sep 2016 11:50:57 +0000 (13:50 +0200)
committerCarl Eugen Hoyos <cehoyos@ag.or.at>
Thu, 15 Sep 2016 11:50:57 +0000 (13:50 +0200)
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.

libavformat/rtsp.c

index 15e1ab83952e5189d4b3ca53eb0961a1ca7a3360..c6292c5543146c707904f90e1334abcc7e967f12 100644 (file)
@@ -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) {