Commit 82b9799b authored by Martin Storsjö's avatar Martin Storsjö

sdp: Check that fmt->oformat is non-null before accessing it

This avoids crashes when avserver tries to create an SDP, since
d77f4afa.

CC: libav-stable@libav.org
Signed-off-by: 's avatarMartin Storsjö <martin@martin.st>
parent 9d18a7d3
......@@ -402,7 +402,7 @@ static char *sdp_write_media_attributes(char *buff, int size, AVCodecContext *c,
switch (c->codec_id) {
case AV_CODEC_ID_H264: {
int mode = 1;
if (fmt && fmt->oformat->priv_class &&
if (fmt && fmt->oformat && fmt->oformat->priv_class &&
av_opt_flag_is_set(fmt->priv_data, "rtpflags", "h264_mode0"))
mode = 0;
if (c->extradata_size) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment