rtp: Make sure the output format pointer is set
authorMartin Storsjö <martin@martin.st>
Wed, 23 Jan 2013 21:21:52 +0000 (23:21 +0200)
committerMartin Storsjö <martin@martin.st>
Thu, 24 Jan 2013 09:31:35 +0000 (11:31 +0200)
Not sure if this actually happens, but we do the same check when
checking payload_type further above in the function, so it might
be needed.

Signed-off-by: Martin Storsjö <martin@martin.st>
libavformat/rtp.c

index d1c6ed09aa27adac7cbf78746d1a557ccb9133aa..e827c2e0ab59dac38d6e745178b73c6e253ff8e9 100644 (file)
@@ -103,7 +103,7 @@ int ff_rtp_get_payload_type(AVFormatContext *fmt,
     /* static payload type */
     for (i = 0; rtp_payload_types[i].pt >= 0; ++i)
         if (rtp_payload_types[i].codec_id == codec->codec_id) {
-            if (codec->codec_id == AV_CODEC_ID_H263 && (!fmt ||
+            if (codec->codec_id == AV_CODEC_ID_H263 && (!fmt || !fmt->oformat ||
                 !fmt->oformat->priv_class || !fmt->priv_data ||
                 !av_opt_flag_is_set(fmt->priv_data, "rtpflags", "rfc2190")))
                 continue;