diff options
author | Martin Storsjö <martin@martin.st> | 2014-01-03 15:47:02 +0200 |
---|---|---|
committer | Reinhard Tartler <siretart@tauware.de> | 2014-01-05 16:49:49 -0500 |
commit | 12479588d7894a6d9827c53d89f235e006b95533 (patch) | |
tree | aae9ba4de8b3c63a4fb7a955ba3992bebc10002c /libavformat | |
parent | 3e089e8f7158176edc019182d2177f5797e1cad2 (diff) | |
download | ffmpeg-12479588d7894a6d9827c53d89f235e006b95533.tar.gz |
sdp: Check that fmt->oformat is non-null before accessing it
This avoids crashes when avserver tries to create an SDP, since
d77f4af.
Addresses: CVE-2012-6617
CC: libav-stable@libav.org
Signed-off-by: Martin Storsjö <martin@martin.st>
(cherry picked from commit 82b9799bb211ecd117171115e4a8b832c4942314)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
Diffstat (limited to 'libavformat')
-rw-r--r-- | libavformat/sdp.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/libavformat/sdp.c b/libavformat/sdp.c index 57044d4c51..e6e6f829d4 100644 --- a/libavformat/sdp.c +++ b/libavformat/sdp.c @@ -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) { |