[FFmpeg-cvslog] rtp: Make sure priv_data is set before reading it

Martin Storsjö git at videolan.org
Tue Feb 5 16:27:13 CET 2013


ffmpeg | branch: release/1.1 | Martin Storsjö <martin at martin.st> | Wed Jan 23 21:38:41 2013 +0200| [62de693a17f9b107be7867d822d5accacd4be544] | committer: Martin Storsjö

rtp: Make sure priv_data is set before reading it

This fixes crashes with muxing H263 into RTSP.

CC: libav-stable at libav.org
Signed-off-by: Martin Storsjö <martin at martin.st>
(cherry picked from commit e90820d4f815c15796e642467cdddbad755212a2)

Signed-off-by: Martin Storsjö <martin at martin.st>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=62de693a17f9b107be7867d822d5accacd4be544
---

 libavformat/rtp.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavformat/rtp.c b/libavformat/rtp.c
index 38b2348..9a7d44b 100644
--- a/libavformat/rtp.c
+++ b/libavformat/rtp.c
@@ -108,7 +108,7 @@ int ff_rtp_get_payload_type(AVFormatContext *fmt,
     for (i = 0; AVRtpPayloadTypes[i].pt >= 0; ++i)
         if (AVRtpPayloadTypes[i].codec_id == codec->codec_id) {
             if (codec->codec_id == AV_CODEC_ID_H263 && (!fmt ||
-                !fmt->oformat->priv_class ||
+                !fmt->oformat->priv_class || !fmt->priv_data ||
                 !av_opt_flag_is_set(fmt->priv_data, "rtpflags", "rfc2190")))
                 continue;
             /* G722 has 8000 as nominal rate even if the sample rate is 16000,



More information about the ffmpeg-cvslog mailing list