From: Martin Storsjö Date: Thu, 20 Dec 2012 11:53:27 +0000 (+0200) Subject: rtp: Don't read priv_data unless it is allocated X-Git-Tag: android-x86-4.4-r1~364^2~2397 X-Git-Url: http://git.osdn.net/view?a=commitdiff_plain;h=a925f723a915bc0255e2673f8817af5212131763;p=android-x86%2Fexternal-ffmpeg.git rtp: Don't read priv_data unless it is allocated This makes all users of rtpenc_chain (rtsp muxer, sapenc, mov rtp hinting) work again, broken since 8034130e0. Signed-off-by: Martin Storsjö --- diff --git a/libavformat/rtp.c b/libavformat/rtp.c index 651220692c..38b2348d45 100644 --- a/libavformat/rtp.c +++ b/libavformat/rtp.c @@ -97,7 +97,7 @@ int ff_rtp_get_payload_type(AVFormatContext *fmt, AVOutputFormat *ofmt = fmt ? fmt->oformat : NULL; /* Was the payload type already specified for the RTP muxer? */ - if (ofmt && ofmt->priv_class) { + if (ofmt && ofmt->priv_class && fmt->priv_data) { int64_t payload_type; if (av_opt_get_int(fmt->priv_data, "payload_type", 0, &payload_type) >= 0 && payload_type >= 0)