mirror of https://git.ffmpeg.org/ffmpeg.git
rtp: Make sure priv_data is set before reading it
This fixes crashes with muxing H263 into RTSP. CC: libav-stable@libav.org Signed-off-by: Martin Storsjö <martin@martin.st>
This commit is contained in:
parent
cf29f49d8a
commit
e90820d4f8
|
@ -104,7 +104,7 @@ int ff_rtp_get_payload_type(AVFormatContext *fmt,
|
||||||
for (i = 0; rtp_payload_types[i].pt >= 0; ++i)
|
for (i = 0; rtp_payload_types[i].pt >= 0; ++i)
|
||||||
if (rtp_payload_types[i].codec_id == codec->codec_id) {
|
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->priv_class ||
|
!fmt->oformat->priv_class || !fmt->priv_data ||
|
||||||
!av_opt_flag_is_set(fmt->priv_data, "rtpflags", "rfc2190")))
|
!av_opt_flag_is_set(fmt->priv_data, "rtpflags", "rfc2190")))
|
||||||
continue;
|
continue;
|
||||||
/* G722 has 8000 as nominal rate even if the sample rate is 16000,
|
/* G722 has 8000 as nominal rate even if the sample rate is 16000,
|
||||||
|
|
Loading…
Reference in New Issue